Skip to content

Conversation

bbovenzi
Copy link
Contributor

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 seconds

Durations 1 day or longer will be: 1d01:34:41 for 1 day, 1 hour, 34 minutes, 41 seconds

Closes #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.

@bbovenzi bbovenzi added this to the Airflow 3.0.1 milestone Apr 28, 2025
@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Apr 28, 2025
@bbovenzi
Copy link
Contributor Author

@josh-fell @tirkarthi Let me know if this makes sense to you all

Copy link
Member

@pierrejeambrun pierrejeambrun left a 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...)

Copy link
Contributor

@tirkarthi tirkarthi left a 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`}

Copy link
Contributor

@josh-fell josh-fell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥

@bbovenzi bbovenzi merged commit e97ae32 into apache:main Apr 29, 2025
42 checks passed
@bbovenzi bbovenzi deleted the new-duration-format branch April 29, 2025 18:55
mvfc pushed a commit to mvfc/airflow that referenced this pull request Apr 29, 2025
* Update time duration format

* Simplift datetimeUtils and remove extra s

* Fix tests
jroachgolf84 pushed a commit to jroachgolf84/airflow that referenced this pull request Apr 30, 2025
* Update time duration format

* Simplift datetimeUtils and remove extra s

* Fix tests
kaxil pushed a commit that referenced this pull request Apr 30, 2025
* Update time duration format

* Simplift datetimeUtils and remove extra s

* Fix tests

(cherry picked from commit e97ae32)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:UI Related to UI/UX. For Frontend Developers.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show task, DAG detail durations in hour:minute:second format rather than just seconds
4 participants