Serialize timedelta objects in parseable form#837
Merged
maddenp-cu merged 3 commits intoufs-community:mainfrom Jan 8, 2026
Merged
Serialize timedelta objects in parseable form#837maddenp-cu merged 3 commits intoufs-community:mainfrom
maddenp-cu merged 3 commits intoufs-community:mainfrom
Conversation
maddenp-cu
commented
Jan 8, 2026
elcarpenterNOAA
approved these changes
Jan 8, 2026
maddenp-cu
added a commit
to maddenp-cu/uwtools
that referenced
this pull request
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Synopsis
This issue came up in practice. Given
a.yamlCurrent behavior:
The problem is that the value
'1 day, 16:48:00'that appears inb.yaml, which is the standard representation of thetimedeltaobject given by callingstr()on it, is not parseable byuwtoolsas atimedeltaobject.New behavior:
It's fine for the
timedeltaobject to be internally represented as1 day, 16:48:00, but when it is serialized (dumped) to YAML, it needs to be in the format thatuwtoolssupports so that it can be read in again later.After this merges, I'd like to do a
v2.12.2bugfix release of this, too.Type
Impact
Checklist