Skip to content

Commit

Permalink
Exclude materializing run from materialization warning run count (#6692)
Browse files Browse the repository at this point in the history
  • Loading branch information
clairelin135 committed Feb 28, 2022
1 parent 4dbfa80 commit 9dd063a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ def get_asset_runs_count_by_step(graphene_info, asset_nodes):
for job_name in job_names
]
)

# If a materialization has occurred, we subtract one so that the runs count
# does not include the run that generated the materialization.
if event:
runs_count -= 1

jobs_runs_count[step_key] = GrapheneJobRunsCount(
step_key, job_names, runs_count, True if event else False
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,8 +769,8 @@ def get_response_by_step(response):
assert result.data["repositoryOrError"]
result = get_response_by_step(result.data["repositoryOrError"]["latestRunByStep"])
assert result["asset_1"]["jobNames"] == ["failure_assets_job"]
# A job containing asset 1 was run 6 times, since latest materialization
assert result["asset_1"]["count"] == 6
# A job containing asset 1 was run 5 times, since latest materialization
assert result["asset_1"]["count"] == 5
assert result["asset_1"]["sinceLatestMaterialization"] == True
# A job containing asset 2 was run 6 times, asset 2 was never materialized
assert result["asset_2"]["count"] == 6
Expand Down

0 comments on commit 9dd063a

Please sign in to comment.