Skip to content

Commit

Permalink
add back ingest_data_platform_instance_aspect
Browse files Browse the repository at this point in the history
  • Loading branch information
asikowitz committed Oct 5, 2023
1 parent 3cbce63 commit af0622c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,12 @@ class UnityCatalogSourceConfig(
),
)

_ingest_data_platform_instance_aspect_removed = pydantic_removed_field(
"ingest_data_platform_instance_aspect"
ingest_data_platform_instance_aspect: Optional[bool] = pydantic.Field(
default=False,
description=(
"Option to enable/disable ingestion of the data platform instance aspect."
" The default data platform instance id for a dataset is workspace_name"
),
)

_only_ingest_assigned_metastore_removed = pydantic_removed_field(
Expand Down
20 changes: 12 additions & 8 deletions metadata-ingestion/src/datahub/ingestion/source/unity/source.py
Original file line number Diff line number Diff line change
Expand Up @@ -672,15 +672,19 @@ def _create_table_ownership_aspect(self, table: Table) -> Optional[OwnershipClas
)
return None

def _create_data_platform_instance_aspect(self) -> DataPlatformInstanceClass:
return DataPlatformInstanceClass(
platform=make_data_platform_urn(self.platform),
instance=make_dataplatform_instance_urn(
self.platform, self.platform_instance_name
def _create_data_platform_instance_aspect(
self,
) -> Optional[DataPlatformInstanceClass]:
if self.config.ingest_data_platform_instance_aspect:
return DataPlatformInstanceClass(
platform=make_data_platform_urn(self.platform),
instance=make_dataplatform_instance_urn(
self.platform, self.platform_instance_name
)
if self.platform_instance_name
else None,
)
if self.platform_instance_name
else None,
)
return None

def _create_table_sub_type_aspect(self, table: Table) -> SubTypesClass:
return SubTypesClass(
Expand Down

0 comments on commit af0622c

Please sign in to comment.