-
Notifications
You must be signed in to change notification settings - Fork 15.6k
Update time duration format #49914
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
Update time duration format #49914
Conversation
@josh-fell @tirkarthi Let me know if this makes sense to you all |
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.
Nice, beside the 00
that will be forced double digit because this is handled as a special case, everything under < 10 will be displayed single digit. (1d1h1m1s...)
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.
There are places where getDuration
is used and then the formatted string also has s
at the end to show seconds which should be updated since it results in 0.6ss
for example in TaskInstance Header component.
rg 'getDuration.*\}s' src/pages/
src/pages/Run/Header.tsx
107: { label: "Duration", value: `${getDuration(dagRun.start_date, dagRun.end_date)}s` },
src/pages/Run/Details.tsx
93: <Table.Cell>{getDuration(dagRun.start_date, dagRun.end_date)}s</Table.Cell>
src/pages/TaskInstances/TaskInstances.tsx
143: Boolean(original.start_date) ? `${getDuration(original.start_date, original.end_date)}s` : "",
src/pages/MappedTaskInstance/Header.tsx
49: ? [{ label: "Duration", value: `${getDuration(taskInstance.start_date, taskInstance.end_date)}s` }]
src/pages/TaskInstance/Header.tsx
51: ? [{ label: "Duration", value: `${getDuration(taskInstance.start_date, taskInstance.end_date)}s` }]
src/pages/TaskInstance/Details.tsx
163: ? `${getDuration(tryInstance?.start_date ?? null, tryInstance?.end_date ?? null)}s`
src/pages/Dag/Backfills/Backfills.tsx
92: : `${getDuration(row.original.created_at, row.original.completed_at)}s`}
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.
🔥
* Update time duration format * Simplift datetimeUtils and remove extra s * Fix tests
* Update time duration format * Simplift datetimeUtils and remove extra s * Fix tests
* Update time duration format * Simplift datetimeUtils and remove extra s * Fix tests (cherry picked from commit e97ae32)
Any duration less than 10 seconds will be:
9.42s
Any duration longer than 10 seconds will be:
3:12:34
for 3 hours, 12 minutes, 34 secondsDurations 1 day or longer will be:
1d01:34:41
for 1 day, 1 hour, 34 minutes, 41 secondsCloses #49507
^ 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.rst
or{issue_number}.significant.rst
, in airflow-core/newsfragments.