-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Fix Start Date tooltip on DAGs page not showing actual start_date #10637
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -726,7 +726,9 @@ def last_dagruns(self, session=None): | |
| return wwwutils.json_response({}) | ||
|
|
||
| query = session.query( | ||
| DagRun.dag_id, sqla.func.max(DagRun.execution_date).label('last_run') | ||
| DagRun.dag_id, | ||
| sqla.func.max(DagRun.execution_date).label('execution_date'), | ||
| sqla.func.max(DagRun.start_date).label('start_date'), | ||
|
||
| ).group_by(DagRun.dag_id) | ||
|
|
||
| # Filter to only ask for accessible and selected dags | ||
|
|
@@ -735,7 +737,8 @@ def last_dagruns(self, session=None): | |
| resp = { | ||
| r.dag_id.replace('.', '__dot__'): { | ||
| 'dag_id': r.dag_id, | ||
| 'last_run': r.last_run.isoformat(), | ||
| 'execution_date': r.execution_date.isoformat(), | ||
| 'start_date': r.start_date.isoformat(), | ||
| } for r in query | ||
| } | ||
| return wwwutils.json_response(resp) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point this function name needs changing too
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, I am not adding new functionality, just fixing a bug/regression. I am just putting back a value lost when the values were changed to load asynchronously. But it is a valid point as that function was added at that point it was changed to be asynchronous.
This function appears to be named the same as the
/last_dagrunsendpoint that returns json for these dates, which is in turn seems to be named after the "Last Run" column this tooltip is in. So the column is showing the last run's execution date and the last run's start date. What name should it be instead?Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correction, the function is named after the
dag.get_last_dagrunmethod which was used in the pre-asynchronous code for the value oflast_run, which then was used for the valueslast_run.execution_dateandlast_run.start_date, but was incorrectly changed to be last_run = execution_date when it went asynchronous in commit 6607e48#diff-f38558559ea1b4c30ddf132b7f223cf9L122. This PR just puts the values for the asynchronous code back to as they were.