Skip to content
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

add model_incremental_strategy to track_model_run #10758

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changes/unreleased/Features-20240923-155335.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
kind: Features
body: Track incremental_strategy as part of model_run tracking event
time: 2024-09-23T15:53:35.898928+01:00
custom:
Author: michelleark
Issue: "10761"
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 @@
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 @@
"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
Loading