Skip to content

fix: add missing days (d) unit to parse_duration - #119

Open
qvkap wants to merge 1 commit into
tine1117:mainfrom
qvkap:fix/parse-duration-days
Open

qvkap wants to merge 1 commit into
tine1117:mainfrom
qvkap:fix/parse-duration-days

Conversation

@qvkap

@qvkap qvkap commented Aug 17, 2026

Copy link
Copy Markdown

Summary

parse_duration silently dropped the d (days) unit because it was matched by the token regex but not present in the _UNITS dictionary.

Changes

  • Added "d": 86400 to _UNITS in duration_utils.py
  • Added test_days and test_days_combined test cases

Verification

All 9 tests pass:

test_days ... ok
test_days_combined ... ok
test_hours ... ok
test_minutes ... ok
test_seconds ... ok
test_weeks ... ok
test_combined ... ok
test_invalid_raises ... ok
test_empty_raises ... ok

Closes #1

parse_duration silently dropped the days unit because 'd' was matched
by the token regex but not present in the _UNITS dictionary.

- Added 'd': 86400 to _UNITS
- Added test_days and test_days_combined tests

Closes tine1117#1
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.

parse_duration drops the days (d) unit

1 participant