Skip to content

Commit

Permalink
feat(ingest): snowflake - support deletion of containers in snowflake…
Browse files Browse the repository at this point in the history
… stateful ingestion (#6180)
  • Loading branch information
mayurinehate authored Oct 17, 2022
1 parent 4abe0d2 commit 98ba36c
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from snowflake.connector import SnowflakeConnection

from datahub.emitter.mce_builder import (
make_container_urn,
make_data_platform_urn,
make_dataplatform_instance_urn,
make_dataset_urn,
Expand Down Expand Up @@ -789,6 +790,14 @@ def add_table_to_schema_container(
container_key=schema_container_key,
dataset_urn=dataset_urn,
)

self.stale_entity_removal_handler.add_entity_to_state(
type="container",
urn=make_container_urn(
guid=schema_container_key.guid(),
),
)

for wu in container_workunits:
self.report.report_workunit(wu)
yield wu
Expand Down Expand Up @@ -838,6 +847,13 @@ def gen_database_containers(
domain_urn=domain_urn,
)

self.stale_entity_removal_handler.add_entity_to_state(
type="container",
urn=make_container_urn(
guid=database_container_key.guid(),
),
)

for wu in container_workunits:
self.report.report_workunit(wu)
yield wu
Expand Down

0 comments on commit 98ba36c

Please sign in to comment.