-
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
Conversation
ryw
left a comment
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.
LGTM, and I believe this is the right direction. I'd say we merge this in, then @alexbegg you can add next_run in a second PR?
|
@ryw yeah, I'll make a second PR to add a next_run date |
|
Great! BTW tooltip seems not to work on all browsers #10279 |
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
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_dagruns endpoint 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?
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_dagrun method which was used in the pre-asynchronous code for the value of last_run, which then was used for the values last_run.execution_date and last_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.
@JeffryMAC thanks for the heads up, I'll try to look into that |
airflow/www/views.py
Outdated
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.
This could be incorrect an some (unlikely) circumstance:
If I create an dag run for an older execution_date, this would show mixed values.
Unfortunately doing this correctly in a single SQL query is harder.
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.
I can test for that, thanks for the heads up. However I would think the value above it, the execution_date, would be wrong to get the max value in the query, not the run_date. I don't recall that being the case as that query has been the same for a long time now (I just renamed the column alais) but if it is wrong, I'll try and fix it.
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.
Sorry, got busy with other stuff, I'll look into this soon
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.
Fair point -- if you could rebase this PR we can merge this as is, as this is right in most cases, and better than the current broken behavior.
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.
rebased now
f399294 to
0e24bf4
Compare
Closes: #10350
Replaces PR #10556
It has been reported that the last run's execution date was incorrectly being displayed for both the last run's link text as well as the "Start Date" in the (i) tooltip on the DAGs page. This was happening in the RBAC UI. For example, this was wrong, the "Start Date" was not

2020-08-08T00:00:00+00:00, that is theexecution_date:This PR fixes it so it shows the actual

start_datefor the "Start Date" tooltip instead of theexecution_date, like it used to do in non-RBAC (Flask-admin) UI and before the RBAC UI was changed to load the latest_dagruns asynchronously:Ever since the PR #4005 which loads the latest_dagruns asynchronously the correct Start Date was lost. This PR replaces the correct Start Date.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code change, Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in UPDATING.md.