Skip to content

dehumanize: reject non-string input before locale matching - #1330

Open
HrachShah wants to merge 6 commits into
arrow-py:masterfrom
HrachShah:patch/dehumanize-input-type
Open

dehumanize: reject non-string input before locale matching#1330
HrachShah wants to merge 6 commits into
arrow-py:masterfrom
HrachShah:patch/dehumanize-input-type

Conversation

@HrachShah

Copy link
Copy Markdown

Arrow.dehumanize() documents a string input, but non-string values previously reached locale matching and could fail with implementation-dependent errors. Validate the public argument before iterating locale timeframes so callers consistently receive a TypeError naming the expected type.

Added a regression for None.

Tests: python -m pytest tests/test_arrow.py -k "TestArrowDehumanize and non_string_input" --override-ini="addopts="

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (2224255) to head (09b7160).

Additional details and impacted files
@@            Coverage Diff            @@
##            master     #1330   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines         2315      2318    +3     
  Branches       358       359    +1     
=========================================
+ Hits          2315      2318    +3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

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.

1 participant