Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check schema metadata #58

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
harsha-mandadi-4026 marked this conversation as resolved.
Show resolved Hide resolved
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
Loading