Skip to content

Commit

Permalink
fix(ingest): cleanup unused flake8 noqa statements (#5492)
Browse files Browse the repository at this point in the history
* fix(ingest): cleanup unused flake8 noqa statements

In the future, we can discover these using `flake8-noqa`.

* add back c901
  • Loading branch information
hsheth2 authored Jul 27, 2022
1 parent 5981fdd commit 690443c
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from unittest.mock import patch

# This import verifies that the dependencies are available.
import cx_Oracle # noqa: F401
import cx_Oracle
import pydantic
from pydantic.fields import Field
from sqlalchemy import event
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

# These imports verify that the dependencies are available.
import psycopg2 # noqa: F401
import pydantic # noqa: F401
import pydantic
import sqlalchemy
import sqlalchemy_redshift # noqa: F401
from pydantic.fields import Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ def _get_domain_wu(
entity_urn: str,
entity_type: str,
sql_config: SQLAlchemyConfig,
) -> Iterable[Union[MetadataWorkUnit]]:
) -> Iterable[MetadataWorkUnit]:

domain_urn = self._gen_domain_urn(dataset_name)
if domain_urn:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sqlalchemy.engine.reflection import Inspector
from sqlalchemy.sql import sqltypes
from sqlalchemy.sql.type_api import TypeEngine
from trino.exceptions import TrinoQueryError # noqa
from trino.exceptions import TrinoQueryError
from trino.sqlalchemy import datatype, error
from trino.sqlalchemy.dialect import TrinoDialect

Expand Down
6 changes: 3 additions & 3 deletions metadata-ingestion/src/datahub/telemetry/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ def __lt__(self, __other: Any) -> Any:
...


SupportsComparisonT = TypeVar("SupportsComparisonT", bound=SupportsLT) # noqa: Y001
_SupportsComparisonT = TypeVar("_SupportsComparisonT", bound=SupportsLT)


def calculate_percentiles(
data: List[SupportsComparisonT], percentiles: List[int]
) -> Dict[int, SupportsComparisonT]:
data: List[_SupportsComparisonT], percentiles: List[int]
) -> Dict[int, _SupportsComparisonT]:
size = len(data)

if size == 0:
Expand Down
4 changes: 2 additions & 2 deletions metadata-ingestion/tests/integration/lookml/test_lookml.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

from datahub.configuration.common import PipelineExecutionError
from datahub.ingestion.run.pipeline import Pipeline
from tests.test_helpers import mce_helpers # noqa: F401
from tests.test_helpers import mce_helpers

logging.getLogger("lkml").setLevel(logging.INFO)

Expand Down Expand Up @@ -229,7 +229,7 @@ def ingestion_test(
tmp_path: pathlib.Path,
mock_time: int,
mock_connection: DBConnection,
) -> None: # noqa : No need for type annotations here
) -> None:
test_resources_dir = pytestconfig.rootpath / "tests/integration/lookml"
mce_out_file = f"lookml_mces_api_{mock_connection.dialect_name}.json"
mocked_client = mock.MagicMock()
Expand Down

0 comments on commit 690443c

Please sign in to comment.