Skip to content

Commit

Permalink
replaces dbt urn with snowflake urn
Browse files Browse the repository at this point in the history
  • Loading branch information
lzrlee committed Nov 13, 2023
1 parent 3ee80da commit b87184a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/impact_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,10 +200,11 @@ def get_datahub_info(graph: DataHubGraph, urn: str) -> Optional[DatasetPropertie


def get_impact_analysis(graph: DataHubGraph, urn: str):
query_urn = urn.replace("urn:li:dataPlatform:dbt", "urn:li:dataPlatform:snowflake")
result = graph.execute_graphql(
IMPACT_ANALYSIS_QUERY,
variables={
"urn": urn,
"urn": query_urn,
"count": MAX_DOWNSTREAMS_TO_FETCH,
},
)
Expand All @@ -221,7 +222,9 @@ def get_impact_analysis(graph: DataHubGraph, urn: str):
# downstreams.sort(key=lambda x: x["degree"])

downstream_details = [downstream["entity"] for downstream in downstreams]
print(f"urn: {urn}, downstreams: {len(downstream_details)}")

print(f"urn: {urn}, query_urn: {query_urn}, downstreams: {len(downstream_details)}")

return downstream_details


Expand All @@ -246,6 +249,8 @@ def dbt_impact_analysis() -> str:
}
print("URN to DBT ids:", urn_to_dbt_id)



# Step 3 - generate downstream impact analysis for each datahub urn.
downstreams_report = {urn: get_impact_analysis(graph, urn) for urn in urns}

Expand Down

0 comments on commit b87184a

Please sign in to comment.