Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove when from naturaldelta() and allow largest timedelta #250

Merged
merged 4 commits into from
Feb 12, 2022
Merged

Remove when from naturaldelta() and allow largest timedelta #250

merged 4 commits into from
Feb 12, 2022

Conversation

carterbox
Copy link
Contributor

@carterbox carterbox commented Dec 30, 2021

Changes proposed in this pull request:

  • Refactor naturaldelta() to remove the when parameter, deprecated in #248
  • Refactor naturaldelta() to no longer use _data_and_delta so that the maximum timedelta can be used

These tests are irrelevant now that the user is responsible for constructing
a timedelta.
Should be able to handle a 999,999,999 day timedelta because that is the
max allowed for the datetime library.
This parameter doesn't make sense when the input should be a timedelta
(and not a datetime). The refactoring allow allows using the largest timedelta without causing an OverflowError.

Fixes #245 Fixes #247
@codecov-commenter
Copy link

codecov-commenter commented Dec 30, 2021

Codecov Report

Merging #250 (eb3e253) into master (309e7fd) will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #250      +/-   ##
==========================================
- Coverage   97.65%   97.63%   -0.02%     
==========================================
  Files          10       10              
  Lines         681      676       -5     
==========================================
- Hits          665      660       -5     
  Misses         16       16              
Flag Coverage Δ
GHA_Ubuntu 96.44% <100.00%> (-0.03%) ⬇️
GHA_Windows 96.15% <100.00%> (-0.03%) ⬇️
GHA_macOS 96.44% <100.00%> (-0.03%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
tests/test_time.py 100.00% <ø> (ø)
src/humanize/time.py 98.17% <100.00%> (+0.01%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 309e7fd...eb3e253. Read the comment docs.

@hugovk hugovk added the changelog: Removed For now removed features label Jan 1, 2022
@hugovk hugovk merged commit 66b8a63 into jmoiron:master Feb 12, 2022
@hugovk
Copy link
Collaborator

hugovk commented Feb 12, 2022

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: Removed For now removed features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants