Skip to content

Fix td_format zero duration behavior for 0 values - #62123

Merged
vincbeck merged 1 commit into
apache:mainfrom
AhmedAli58:codex/fix-td-format-zero-duration
Feb 18, 2026
Merged

vincbeck merged 1 commit into
apache:mainfrom
AhmedAli58:codex/fix-td-format-zero-duration

Conversation

@AhmedAli58

Copy link
Copy Markdown
Contributor

What

Fix td_format() to treat zero durations as under one second (<1s) instead of returning None.\n\n## Why\nThe function docs state values below one second should return <1s>, but 0, 0.0, and timedelta(0) were treated as falsy and returned None.\n\n## How\n- Change the early-return guard from if not td_object to if td_object is None\n- Add regression tests for timedelta(0), 0.0, and 0\n\n## Verification\nPYTHONPATH=shared/timezones/src python3 -m pytest -q shared/timezones/tests\n- 30 passed

@vincbeck
vincbeck merged commit 4c82805 into apache:main Feb 18, 2026
61 checks passed
@boring-cyborg

boring-cyborg Bot commented Feb 18, 2026

Copy link
Copy Markdown

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

dominikhei pushed a commit to dominikhei/airflow that referenced this pull request Mar 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants