Skip to content

Commit

Permalink
add model_incremental_strategy to track_model_run
Browse files Browse the repository at this point in the history
  • Loading branch information
MichelleArk committed Sep 23, 2024
1 parent db69473 commit 2d6f1be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions core/dbt/task/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,12 @@ def track_model_run(index, num_nodes, run_model_result):
access = node.access.value if node.access is not None else None
contract_enforced = node.contract.enforced
versioned = True if node.version else False
incremental_strategy = node.config.incremental_strategy

Check warning on line 119 in core/dbt/task/run.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/run.py#L119

Added line #L119 was not covered by tests
else:
access = None
contract_enforced = False
versioned = False
incremental_strategy = None

Check warning on line 124 in core/dbt/task/run.py

View check run for this annotation

Codecov / codecov/patch

core/dbt/task/run.py#L124

Added line #L124 was not covered by tests
tracking.track_model_run(
{
"invocation_id": invocation_id,
Expand All @@ -130,6 +132,7 @@ def track_model_run(index, num_nodes, run_model_result):
"run_skipped": run_model_result.status == NodeStatus.Skipped,
"run_error": run_model_result.status == NodeStatus.Error,
"model_materialization": node.get_materialization(),
"model_incremental_strategy": incremental_strategy,
"model_id": utils.get_hash(node),
"hashed_contents": utils.get_hashed_contents(node),
"timing": [t.to_dict(omit_none=True) for t in run_model_result.timing],
Expand Down
2 changes: 1 addition & 1 deletion core/dbt/tracking.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
RESOURCE_COUNTS = "iglu:com.dbt/resource_counts/jsonschema/1-0-1"
RPC_REQUEST_SPEC = "iglu:com.dbt/rpc_request/jsonschema/1-0-1"
RUNNABLE_TIMING = "iglu:com.dbt/runnable/jsonschema/1-0-0"
RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-3"
RUN_MODEL_SPEC = "iglu:com.dbt/run_model/jsonschema/1-0-4"
PLUGIN_GET_NODES = "iglu:com.dbt/plugin_get_nodes/jsonschema/1-0-0"

SNOWPLOW_TRACKER_VERSION = Version(snowplow_version)
Expand Down

0 comments on commit 2d6f1be

Please sign in to comment.