Skip to content

Commit

Permalink
fix: return None if no pipeline state is found (#2823)
Browse files Browse the repository at this point in the history
  • Loading branch information
niross authored Oct 24, 2023
1 parent 26e57d8 commit b87a984
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 4 additions & 0 deletions dataworkspace/dataworkspace/apps/datasets/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,10 @@ def get_pipeline_last_success_date(self):
return None
return get_pipeline_last_success_date(pipeline_name)

def pipeline_last_run_success(self):
last_state = self.get_pipeline_last_run_state()
return last_state == "success" if last_state is not None else None


class SourceTableFieldDefinition(models.Model):
field = models.CharField(
Expand Down
3 changes: 1 addition & 2 deletions dataworkspace/dataworkspace/apps/datasets/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,8 +453,7 @@ def _get_context_data_for_master_dataset(self, ctx, **kwargs):
include_types=True,
),
tools_links=get_tools_links_for_user(self.request.user, self.request.scheme),
pipeline_last_run_succeeded=source_table.get_pipeline_last_run_state()
== "success",
pipeline_last_run_succeeded=source_table.pipeline_last_run_success(),
)
for source_table in sorted(source_tables, key=lambda x: x.name)
]
Expand Down

0 comments on commit b87a984

Please sign in to comment.