Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: apply license headers to all the source files #153

Merged
merged 2 commits into from
Jul 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions metadata_service/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import ast
import importlib
import logging
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import logging
from http import HTTPStatus
from typing import Iterable, Union, Mapping, Any, Optional, List
Expand Down
4 changes: 4 additions & 0 deletions metadata_service/api/column.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import json
from http import HTTPStatus
from typing import Iterable, Union
Expand All @@ -14,6 +17,7 @@ class ColumnDescriptionAPI(Resource):
"""
ColumnDescriptionAPI supports PUT and GET operations to upsert column description
"""

def __init__(self) -> None:
self.client = get_proxy_client()
super(ColumnDescriptionAPI, self).__init__()
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/dashboard.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import json
from http import HTTPStatus
from typing import Iterable, Mapping, Optional, Union
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/healthcheck.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import Tuple
from flasgger import swag_from

Expand Down
4 changes: 4 additions & 0 deletions metadata_service/api/popular_tables.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus
from typing import Iterable, List, Mapping, Union

Expand All @@ -13,6 +16,7 @@ class PopularTablesAPI(Resource):
"""
PopularTables API
"""

def __init__(self) -> None:
self.client = get_proxy_client()

Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/system.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus
from typing import Iterable, Union, Mapping

Expand Down
4 changes: 4 additions & 0 deletions metadata_service/api/table.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import json
from http import HTTPStatus
from typing import Any, Iterable, Mapping, Union, Optional
Expand Down Expand Up @@ -71,6 +74,7 @@ class TableDescriptionAPI(Resource):
"""
TableDescriptionAPI supports PUT and GET operation to upsert table description
"""

def __init__(self) -> None:
self.client = get_proxy_client()
super(TableDescriptionAPI, self).__init__()
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/tag.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus
from typing import Iterable, Union, Mapping, Tuple, Any

Expand Down
3 changes: 3 additions & 0 deletions metadata_service/api/user.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import logging
from http import HTTPStatus
from typing import Iterable, Mapping, Optional, Union, Dict, List, Any # noqa: F401
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import distutils.util
import os
from typing import List, Dict, Optional, Set # noqa: F401
Expand Down
2 changes: 2 additions & 0 deletions metadata_service/entity/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions metadata_service/entity/dashboard_detail.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import List
from typing import Optional

Expand Down
3 changes: 3 additions & 0 deletions metadata_service/entity/dashboard_query.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import Optional

import attr
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/entity/dashboard_summary.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import List

import attr
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/entity/description.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import attr
from marshmallow_annotations.ext.attrs import AttrsSchema

Expand Down
3 changes: 3 additions & 0 deletions metadata_service/entity/resource_type.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from enum import Enum, auto


Expand Down
3 changes: 3 additions & 0 deletions metadata_service/entity/tag_detail.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import attr
from marshmallow_annotations.ext.attrs import AttrsSchema

Expand Down
3 changes: 3 additions & 0 deletions metadata_service/exception.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0


class NotFoundException(Exception):
def __init__(self, message: str) -> None:
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/metadata_wsgi.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import os

from metadata_service import create_app
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/oidc_config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from typing import Dict, Optional
from flask import Flask
from amundsen_application.config import LocalConfig
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from threading import Lock

from flask import current_app
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/proxy/atlas_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import logging
import re
from random import randint
Expand Down
4 changes: 4 additions & 0 deletions metadata_service/proxy/aws4authwebsocket/transport.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from gremlin_python.driver.transport import AbstractBaseTransport
import mocket.mocket
import mocket.mockhttp
Expand Down Expand Up @@ -198,6 +201,7 @@ class Aws4AuthWebsocketTransport(WebsocketClientTransport):
>>> g = GraphTraversalSource = Graph().traversal().withRemote(DriverRemoteConnection(url=url, traversal_source='g', transport_factory=factory, websocket_options=dict(http_proxy_host='stupid', http_no_proxy=[urllib.parse.urlparse(url).hostname])))
>>>
""" # noqa

def __init__(self, *, aws_access_key_id: str, aws_secret_access_key: str, service_region: str,
service_name: str = 'neptune-db', extra_aws4auth_options: Mapping[str, Any] = {},
extra_websocket_options: Mapping[str, Any] = {}) -> None:
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/proxy/base_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from abc import ABCMeta, abstractmethod
from typing import Any, Dict, List, Union

Expand Down
5 changes: 5 additions & 0 deletions metadata_service/proxy/gremlin_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import json
import logging
from typing import Any, Dict, List, Mapping, Optional, Union
Expand Down Expand Up @@ -34,6 +37,7 @@ class AbstractGremlinProxy(BaseProxy):
"""
Gremlin Proxy client for the amundsen metadata
"""

def __init__(self, *, key_property_name: str, remote_connection: DriverRemoteConnection) -> None:
# these might vary from datastore type to another, but if you change these while talking to the same instance
# without migration, it will go poorly
Expand Down Expand Up @@ -195,6 +199,7 @@ class GenericGremlinProxy(AbstractGremlinProxy):
:param password: (as optional as your server allows) password
:param driver_remote_connection_options: passed to DriverRemoteConnection's constructor.
"""

def __init__(self, *, host: str, port: Optional[int] = None, user: Optional[str] = None,
password: Optional[str] = None, traversal_source: 'str' = 'g', key_property_name: str = 'key',
driver_remote_connection_options: Mapping[str, Any] = {}) -> None:
Expand Down
4 changes: 4 additions & 0 deletions metadata_service/proxy/janus_graph_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from metadata_service.proxy.aws4authwebsocket.transport import WebsocketClientTransport
from .gremlin_proxy import AbstractGremlinProxy
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
Expand All @@ -9,6 +12,7 @@ class JanusGraphGremlinProxy(AbstractGremlinProxy):
A proxy to a JanusGraph using the Gremlin protocol.

"""

def __init__(self, *, host: str, port: Optional[int] = None, user: Optional[str] = None,
password: Optional[str] = None, traversal_source: 'str' = 'g',
driver_remote_connection_options: Mapping[str, Any] = {},
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/proxy/neo4j_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import logging
import textwrap
import time
Expand Down
4 changes: 4 additions & 0 deletions metadata_service/proxy/neptune_proxy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from metadata_service.proxy.aws4authwebsocket.transport import (Aws4AuthWebsocketTransport,
WebsocketClientTransport)
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
Expand All @@ -20,6 +23,7 @@ class NeptuneGremlinProxy(AbstractGremlinProxy):
See also https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-differences.html
See also https://docs.aws.amazon.com/neptune/latest/userguide/access-graph-gremlin-sessions.html
"""

def __init__(self, *, host: str, port: Optional[int] = None, user: str = None,
password: Optional[Union[str, Mapping[str, str]]] = None,
driver_remote_connection_options: Mapping[str, Any] = {},
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/proxy/statsd_utilities.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import logging
from threading import Lock
from typing import Any, Dict, Callable # noqa: F401
Expand Down
3 changes: 3 additions & 0 deletions metadata_service/util.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from collections import namedtuple


Expand Down
3 changes: 3 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import os

from setuptools import setup, find_packages
Expand Down
2 changes: 2 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions tests/unit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions tests/unit/api/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
2 changes: 2 additions & 0 deletions tests/unit/api/dashboard/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions tests/unit/api/dashboard/dashboard_test_case.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from mock import patch, Mock

from tests.unit.test_basics import BasicTestCase
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/dashboard/test_dashboard_tag_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from metadata_service.exception import NotFoundException
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/table_test_case.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from mock import patch, Mock

from tests.unit.test_basics import BasicTestCase
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_dashboards_using_table_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import unittest
from http import HTTPStatus

Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_table_badge_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import unittest
from http import HTTPStatus

Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_table_description_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from metadata_service.exception import NotFoundException
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_table_detail_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from metadata_service.exception import NotFoundException
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_table_owner_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from tests.unit.api.table.table_test_case import TableTestCase
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/table/test_table_tag_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from metadata_service.exception import NotFoundException
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/api/tag/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
3 changes: 3 additions & 0 deletions tests/unit/api/tag/test_tag_common.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from flask import current_app
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/test_column_description_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from mock import patch, Mock
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/test_popular_tables_api.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

from http import HTTPStatus

from mock import patch, Mock
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/test_redshit_disable_comment_edit.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import json
import unittest
from http import HTTPStatus
Expand Down
3 changes: 3 additions & 0 deletions tests/unit/api/test_user.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0

import unittest

from http import HTTPStatus
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/proxy/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
Loading