Fix dehumanize failing on singular time unit nouns#1254
Open
rstar327 wants to merge 1 commit intoarrow-py:masterfrom
Open
Fix dehumanize failing on singular time unit nouns#1254rstar327 wants to merge 1 commit intoarrow-py:masterfrom
rstar327 wants to merge 1 commit intoarrow-py:masterfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1254 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 10 10
Lines 2315 2317 +2
Branches 358 359 +1
=========================================
+ Hits 2315 2317 +2 ☔ View full report in Codecov by Sentry. |
krisfremen
requested changes
Mar 23, 2026
Member
krisfremen
left a comment
There was a problem hiding this comment.
This feels very biased towards english and/or locales that use s for their plurals. Merging something like this would just invite more hacky patches to add onto the other locales.
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.
Pull Request Checklist
toxormake testto find out!).tox -e lintormake lintto find out!).masterbranch.Description of Changes
dehumanize("1 day ago")raisedValueErrorwhiledehumanize("1 days ago")worked correctly. Same issue affected all singular forms: "1 hour ago", "1 minute ago", "1 week ago", etc.The fix makes the trailing 's' optional in the regex pattern so both singular and plural forms match.
Added
test_singular_unitscovering all 7 time units in both past and future forms. All 1905 tests pass (1904 existing + 1 new).Closes: #1150