fix(python): normalize humanize duration types#682
Open
Cloudymap1e wants to merge 1 commit into
Open
Conversation
|
@JWriter20 This critical case or not |
Collaborator
I'll look into it |
Collaborator
|
Not critical, just good additional input validation. Turns out its not related to the issue it was linked to tho, it is a genuine bug, but not a big one. I will probably add an additional case for handling if the user passes in 0 as well, as this case is handled as disabling the humanization which is not explicit in its intention (either true/false, or a float is what we want) |
JWriter20
approved these changes
Jul 21, 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.
Related Issue
Closes #498
Description
Python's
boolis a subclass ofint, sohumanize=Truewas incorrectly serialized as a numeric duration. Integer durations were also left as integers even though the browser-side configuration parser expects a floating-point value.This change treats Boolean enablement separately and normalizes numeric durations to
float.Trueenables humanization without writinghumanize:maxTime; explicit integer or floating-point durations produce a floating-pointmaxTime.Type of Change
Testing
python -m pytest pythonlib/tests/test_humanize.py -q: 4 passedpython -m pytest pythonlib/tests -q: 47 passed, 4 skippedFingerprint Report
Not applicable: this corrects Python-side configuration typing and does not change fingerprint patches.
Checklist
Service tests pass (for python library changes) -temporarily out of service lol./service-tester/run_tests.sh --browser-version official/prerelease/146.0.1-alpha.25(attach screenshot)