diff --git a/metadata-ingestion/src/datahub/ingestion/source/kafka.py b/metadata-ingestion/src/datahub/ingestion/source/kafka.py index e28ccac7ec393..0523ec24ebf04 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/kafka.py +++ b/metadata-ingestion/src/datahub/ingestion/source/kafka.py @@ -57,8 +57,8 @@ from datahub.metadata.com.linkedin.pegasus2avro.metadata.snapshot import DatasetSnapshot from datahub.metadata.com.linkedin.pegasus2avro.mxe import MetadataChangeEvent from datahub.metadata.schema_classes import ( - BrowsePathsClass, BrowsePathEntryClass, + BrowsePathsClass, BrowsePathsV2Class, DataPlatformInstanceClass, DatasetPropertiesClass, diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau.py b/metadata-ingestion/src/datahub/ingestion/source/tableau.py index 5b16351fa54cb..ec9d967727075 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau.py @@ -518,19 +518,16 @@ def __init__( # if ignore upstream lineage platforms doesn't contain "postgres", then consult the upstream_postgres_database_whitelist if ( - "postgres" not in self.ignore_upstream_lineage_platforms + "postgres" not in self.ignore_upstream_lineage_platforms and self.config.upstream_postgres_database_whitelist ): self.upstream_postgres_database_whitelist = [ x.strip() - for x in ( - self.config.upstream_postgres_database_whitelist.split(",") - ) + for x in (self.config.upstream_postgres_database_whitelist.split(",")) ] else: # return empty list if the config is not set self.upstream_postgres_database_whitelist = [] - self._authenticate() @@ -1386,9 +1383,9 @@ def emit_custom_sql_datasources(self) -> Iterable[MetadataWorkUnit]: for path in project.strip("/").split("/") ] ) - if datasource.get(tableau_constant.WORKBOOK): + if datasource.get(c.WORKBOOK): browse_paths_V2_path.append( - BrowsePathEntryClass(id=datasource.get(tableau_constant.WORKBOOK).get(tableau_constant.NAME)) + BrowsePathEntryClass(id=datasource.get(c.WORKBOOK).get(c.NAME)) ) browse_paths_V2 = BrowsePathsV2Class(path=browse_paths_V2_path) dataset_snapshot.aspects.append(browse_paths_V2) diff --git a/metadata-ingestion/src/datahub/ingestion/source/tableau_common.py b/metadata-ingestion/src/datahub/ingestion/source/tableau_common.py index 7d128b62f077a..d24631610421c 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/tableau_common.py +++ b/metadata-ingestion/src/datahub/ingestion/source/tableau_common.py @@ -1,8 +1,7 @@ import html import logging -from dataclasses import dataclass - import re +from dataclasses import dataclass from functools import lru_cache from typing import Dict, List, Optional, Tuple diff --git a/metadata-ingestion/src/datahub/utilities/mapping.py b/metadata-ingestion/src/datahub/utilities/mapping.py index 663af1240de71..2607917b16e24 100644 --- a/metadata-ingestion/src/datahub/utilities/mapping.py +++ b/metadata-ingestion/src/datahub/utilities/mapping.py @@ -4,10 +4,10 @@ import re import time from functools import reduce +from typing import Any, Dict, List, Mapping, Match, Optional, Union, cast from jinja2 import Template from jinja2.sandbox import SandboxedEnvironment -from typing import Any, Dict, List, Mapping, Match, Optional, Union, cast from datahub.emitter import mce_builder from datahub.emitter.mce_builder import OwnerType diff --git a/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py b/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py index ee435b6171da0..e185050460296 100644 --- a/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py +++ b/metadata-ingestion/tests/integration/tableau/test_tableau_ingest.py @@ -67,8 +67,8 @@ "config": {"datahub_api": {"server": GMS_SERVER}}, }, }, - "ignore_upstream_lineage_platforms": '', - "upstream_postgres_database_whitelist": 'dvdrental', + "ignore_upstream_lineage_platforms": "", + "upstream_postgres_database_whitelist": "dvdrental", } @@ -522,8 +522,8 @@ def test_tableau_ingest_with_platform_instance( "config": {"datahub_api": {"server": GMS_SERVER}}, }, }, - "ignore_upstream_lineage_platforms": '', - "upstream_postgres_database_whitelist": 'dvdrental', + "ignore_upstream_lineage_platforms": "", + "upstream_postgres_database_whitelist": "dvdrental", } tableau_ingest_common(