Fix truncated execution_date in UI#32465
Conversation
airflow/www/static/js/task.js
Outdated
There was a problem hiding this comment.
Let me know if this is alright or if there's a better solution than this. I focused on solving the issue as described in #28482, and probably overlooked a lot of things.
airflow/www/static/js/task.js
Outdated
There was a problem hiding this comment.
I think we should do this to all execution_date fields that are displayed in the UI. WDYT?
Also, since there are multiple places we are displaying it. We should have common logic to control data-datetime-convert=False attribute in the view layer for execution_date.
There was a problem hiding this comment.
Yes, good idea. I need to rework this a little too. With this solution, the execution date won't be updated when the user changes the display timezone. However, JS date types don't have microsecond precision. So currently the best that can be done is millisecond precision for execution date when displayed in the UI, while at the same time being able to switch display timezone. It won't satisfy the bug report completely though.
Another thing I overlooked is that if data-datetime-convert is true (or unset), the title attribute of the time element will be filled with the datetime in UTC, if the display timezone is set to non-UTC. This solution would break that behavior for execution date too.
Let me know your thoughts.
There was a problem hiding this comment.
Did some rework on this. See updated description of PR. Let me know if I missed any instances of execution_date in the UI!
141a949 to
a67ac94
Compare
|
I find it weird that we have the In the original issue, the date displayed at the top of the taskinstance page is just the 'time', meant by the I don't think this piece of information is supposed to be used to retrieve the |
|
I'm ok with closing this, but then I guess the original bug ticket should be closed too. |
|
Lets see what others think |
|
Yeah, the "Task Id at time" is supposed to just be something more human readable. I'd rather not have too many different date formats without it being clear to a user.Maybe we need to have the Perhaps we should choose whether execution date or run id should be the unique key to show in a table or to search by. |
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed in 5 days if no further activity occurs. Thank you for your contributions. |
Add
data-attributeto time elements in HTML. Configure datetime formatting based on this attribute, all instances ofexecution_dateanddag_run.execution_datewill be formatted as isoformat with milliseconds and timezone. Microseconds precision is unfortunately not possible, because the datetimes are formatted in Javascript.closes: #28482
Examples:
Task instance details:

DAG runs:

Task Instances:

Task instance logs (nothing changed here):

DAG Audit log:

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an 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 a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.