Skip to content

Commit

Permalink
Merge pull request #58 from FundingCircle/GDP-2765-missing-schema-met…
Browse files Browse the repository at this point in the history
…adata

Check schema metadata
  • Loading branch information
isura-nimalasiri authored Jul 10, 2024
2 parents 627678b + 28b4df7 commit 65a3b0f
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion metadata-ingestion/src/datahub/ingestion/source/tableau.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@
OwnershipTypeClass,
SubTypesClass,
ViewPropertiesClass,
SchemaMetadataClass,
EditableSchemaMetadataClass
)
from datahub.sql_parsing.sql_parsing_result_utils import (
transform_parsing_result_to_in_tables_schemas,
Expand Down Expand Up @@ -2250,7 +2252,13 @@ def emit_table(
tableau_columns, database_table.parsed_columns
)
if schema_metadata is not None:
dataset_snapshot.aspects.append(schema_metadata)
# Check if table already has schema metadata
current_schema_aspect = self.ctx.graph.get_aspect(entity_urn=database_table.urn, aspect_type=SchemaMetadataClass)
current_editable_schema_aspect = self.ctx.graph.get_aspect(entity_urn=database_table.urn, aspect_type=EditableSchemaMetadataClass)
if current_schema_aspect or current_editable_schema_aspect:
logger.debug(f"Table {database_table.urn} already has schema metadata, skipping")
else:
dataset_snapshot.aspects.append(schema_metadata)

yield self.get_metadata_change_event(dataset_snapshot)

Expand Down

0 comments on commit 65a3b0f

Please sign in to comment.