diff --git a/metadata-ingestion/src/datahub/ingestion/source/superset.py b/metadata-ingestion/src/datahub/ingestion/source/superset.py index ef90a534271464..7d78c6f4d669d7 100644 --- a/metadata-ingestion/src/datahub/ingestion/source/superset.py +++ b/metadata-ingestion/src/datahub/ingestion/source/superset.py @@ -70,7 +70,6 @@ ChartTypeClass, DashboardInfoClass, DatasetLineageTypeClass, - DatasetLineageTypeClass, DatasetPropertiesClass, GlobalTagsClass, OwnerClass, @@ -79,10 +78,6 @@ TagAssociationClass, UpstreamClass, UpstreamLineageClass, - GlobalTagsClass, - TagAssociationClass, - UpstreamClass, - UpstreamLineageClass, ) from datahub.utilities import config_clean from datahub.utilities.registries.domain_registry import DomainRegistry @@ -342,23 +337,17 @@ def get_datasource_urn_from_id( # Druid do not have a database concept and has a limited schema concept, but they are nonetheless reported # from superset. There is only one database per platform instance, and one schema named druid, so it would be # redundant to systemically store them both in the URN. - if platform_instance in platform_without_databases: if platform_instance in platform_without_databases: database_name = None - if platform_instance == "druid" and schema_name == "druid": if platform_instance == "druid" and schema_name == "druid": # Follow DataHub's druid source convention. schema_name = None - # If the information about the datasource is already contained in the dataset response, - # can just return the urn directly - if table_name and database_id: # If the information about the datasource is already contained in the dataset response, # can just return the urn directly if table_name and database_id: return make_dataset_urn( - platform=platform_instance, platform=platform_instance, name=".".join( name for name in [database_name, schema_name, table_name] if name @@ -366,7 +355,6 @@ def get_datasource_urn_from_id( env=self.config.env, ) - raise ValueError("Could not construct dataset URN") def construct_dashboard_from_api_data( @@ -639,7 +627,6 @@ def construct_dataset_from_dataset_data( dataset_response = self.get_dataset_info(dataset_data.get("id")) dataset = SupersetDataset(**dataset_response["result"]) - datasource_urn = self.get_datasource_urn_from_id( dataset_response, self.platform ) @@ -687,8 +674,6 @@ def construct_dataset_from_dataset_data( ) global_tags = GlobalTagsClass(tags=[TagAssociationClass(tag=tag_urn)]) - global_tags = GlobalTagsClass(tags=[TagAssociationClass(tag=tag_urn)]) - aspects_items: List[Any] = [] aspects_items.extend( [ @@ -696,8 +681,6 @@ def construct_dataset_from_dataset_data( dataset_info, upstream_lineage, global_tags, - upstream_lineage, - global_tags, ] )