Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
elic-eon committed Sep 4, 2024
1 parent 46e1e7f commit 26baaaf
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions metaphor/dbt/cloud/parser/dbt_node_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,13 @@ def _parse_model_meta(
]

def _parse_model_materialization(
self, node: GetJobRunModelsJobModels, dbt_model: DbtModel
self, node: NODE_TYPE, dbt_model: DbtModel
) -> None:
materialized = node.materialized_type
materialized = (
node.materialized_type
if isinstance(node, GetJobRunModelsJobModels)
else "SNAPSHOT"
)
if materialized is None:
return

Expand Down Expand Up @@ -257,18 +261,13 @@ def parse(
dbt_model.raw_sql = node.raw_code or node.raw_sql
dbt_model.compiled_sql = node.compiled_code or node.compiled_sql

self._parse_model_materialization(node, dbt_model)

if isinstance(node, GetJobRunModelsJobModels):
self._parse_model_meta(node, virtual_view)
self._parse_model_materialization(node, dbt_model)
parse_depends_on(
self._virtual_views, node.depends_on, source_map, macro_map, dbt_model
)

if isinstance(node, GetJobRunSnapshotsJobSnapshots):
dbt_model.materialization = DbtMaterialization(
type=DbtMaterializationType.SNAPSHOT,
target_dataset=str(self._get_node_entity_id(node)),
)

self._parse_node_columns(node, dbt_model)
self._set_entity_upstream(virtual_view, dbt_model)

0 comments on commit 26baaaf

Please sign in to comment.