Skip to content

Commit

Permalink
refactor: rename is_failure to is_failure_or_canceled (#7200)
Browse files Browse the repository at this point in the history
  • Loading branch information
rexledesma committed Mar 25, 2022
1 parent 7c69b8e commit e642465
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ def test_retry_requires_intermediates_async_only(self, graphql_context):
_do_retry_intermediates_test(graphql_context, run_id, reexecution_run_id)
reexecution_run = graphql_context.instance.get_run_by_id(reexecution_run_id)

assert reexecution_run.is_failure
assert reexecution_run.is_failure_or_canceled

def test_retry_early_terminate(self, graphql_context):
instance = graphql_context.instance
Expand Down
4 changes: 4 additions & 0 deletions python_modules/dagster/dagster/core/storage/pipeline_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -412,6 +412,10 @@ def is_success(self):

@property
def is_failure(self):
return self.status == PipelineRunStatus.FAILURE

@property
def is_failure_or_canceled(self):
return self.status == PipelineRunStatus.FAILURE or self.status == PipelineRunStatus.CANCELED

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ def failing_init_pipeline():
event = result.event_list[-1]
assert event.event_type_value == "PIPELINE_FAILURE"
assert event.pipeline_failure_data
assert mem_instance.get_run_by_id(result.run_id).is_failure
assert mem_instance.get_run_by_id(result.run_id).is_failure_or_canceled

with instance_for_test() as fs_instance:
result = execute_pipeline(
Expand All @@ -715,7 +715,7 @@ def failing_init_pipeline():
event = result.event_list[-1]
assert event.event_type_value == "PIPELINE_FAILURE"
assert event.pipeline_failure_data
assert fs_instance.get_run_by_id(result.run_id).is_failure
assert fs_instance.get_run_by_id(result.run_id).is_failure_or_canceled


def test_reexecution_fs_storage():
Expand Down

0 comments on commit e642465

Please sign in to comment.