Skip to content

Commit

Permalink
Rearrange construction of params for run_model tracking
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Apr 11, 2023
1 parent aae96bc commit 44440ba
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions core/dbt/task/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,18 +110,14 @@ def track_model_run(index, num_nodes, run_model_result):
invocation_id = get_invocation_id()
node = run_model_result.node
has_group = True if hasattr(node, "group") and node.group else False
access = (
node.access.value
if (node.resource_type == NodeType.Model and node.access is not None)
else None
)
contract_enforced = (
node.contract.enforced
if (node.resource_type == NodeType.Model and node.contract)
else False
)
versioned = True if hasattr(node, "version") and node.version else False

if node.resource_type == NodeType.Model:
access = node.access.value if node.access is not None else None
contract_enforced = node.contract.enforced
versioned = True if node.version else False
else:
access = None
contract_enforced = False
versioned = False
tracking.track_model_run(
{
"invocation_id": invocation_id,
Expand Down

0 comments on commit 44440ba

Please sign in to comment.