-
Notifications
You must be signed in to change notification settings - Fork 3k
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
feat(ingest): switch dbt to use auto_stale_entity_removal
#7160
Conversation
Changes stacked on datahub-project#7158.
"dataset", node_datahub_urn | ||
) | ||
if not is_primary_source: | ||
# We previously, erroneously added non-dbt nodes to the state object. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - thank you for doing this....
metadata-ingestion/src/datahub/ingestion/source/state/stale_entity_removal_handler.py
Show resolved
Hide resolved
if not wu.is_primary_source: | ||
# If this is a non-primary source, we pretend like we've seen the status | ||
# aspect so that we don't try to emit a removal for it. | ||
status_urns.add(urn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooo this is weird. Might want to rename the "status_urns" variable to be something more like.... excluded_urns or something
if entity_type is not None: | ||
stale_entity_removal_handler.add_entity_to_state(entity_type, urn) | ||
else: | ||
stale_entity_removal_handler.add_urn_to_skip(urn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq - why do we also need to call this manually in the DBT source? it seems like just passing a workunit with primary false would exclude this thing?
# We previously, erroneously added non-dbt nodes to the state object. | ||
# This call ensures that we don't try to soft-delete them after an | ||
# upgrade of acryl-datahub. | ||
self.stale_entity_removal_handler.add_urn_to_skip(node_datahub_urn) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq - wouldn't this case already be covered by putting the is_primary_source into the workunit itself?
confused as to why we need both
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we were previously calling the add_entity_to_state for some snowflake nodes that we weren't even emitting. because of that, using the is_primary piece isn't sufficient to avoid soft-deleting stuff that accidentally
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh mannnn
"aspect": { | ||
"value": "{\"timestampMillis\": 1655565136719, \"partitionSpec\": {\"type\": \"FULL_TABLE\", \"partition\": \"FULL_TABLE_SNAPSHOT\"}, \"runId\": \"c7a6b778-0e0f-4789-b567-ca7e124a6840\", \"assertionUrn\": \"urn:li:assertion:fac27f352406b941125292413afa8096\", \"asserteeUrn\": \"urn:li:dataset:(urn:li:dataPlatform:postgres,calm-pagoda-323403.jaffle_shop.stg_payments,PROD)\", \"status\": \"COMPLETE\", \"result\": {\"type\": \"SUCCESS\", \"nativeResults\": {}}}", | ||
"contentType": "application/json" | ||
"json": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice!
Merging through the failures, which are related to glue and fixed by #7185 |
Follow up on #7158.
Checklist