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.
Add/reorganize scalar Timedelta tests #46936
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
Add/reorganize scalar Timedelta tests #46936
Changes from all commits
aa47af9
0957c27
89b2431
51eb151
36d37dc
ef09bb9
d53d1ce
e788c25
d995243
43291f8
4247286
33203b3
1e73327
a72d4e0
7a7418a
b5e62d6
42e597c
36eb26f
c9e209e
4a73340
1bc2741
f00539f
99f927e
d0967da
0dbf13d
a913282
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is one of the main functional changes introduced by this PR as it stands. The motivations:
Timedelta
creation logic, which was divided and duplicated over several functionsTimdelta.__new__
, since (AFAICT) there shouldn't yet be a public API for creating instances with non-nano resolutionOutOfBoundsTimedelta
when its detected.I can move these changes to a separate PR, to keep this one focused on tests alone, if that's desired.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simplifications here are of a piece with the introduction of
create_timedelta
above.Timedelta.__new__
had duplicated much of the logic inconvert_to_timedelta64
, so that's removed. It's now mostly a wrapper aroundcreate_timedelta
, which wrapsconvert_to_timedelta64
and_timedelta_from_value_and_reso
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should really be extracted into a separate function, but that's for later.