BUG: Handle Day offset in to_timedelta #64306
Open
An1k4et wants to merge 6 commits intopandas-dev:mainfrom
Open
BUG: Handle Day offset in to_timedelta #64306An1k4et wants to merge 6 commits intopandas-dev:mainfrom
An1k4et wants to merge 6 commits intopandas-dev:mainfrom
Conversation
|
|
||
| def test_to_timedelta_day_offset(self): | ||
| result = to_timedelta(to_offset("D")) | ||
| expected = pd.Timedelta(days=1) |
Member
There was a problem hiding this comment.
do we have tests that pd.Timedelta(day_offset) works?
Author
There was a problem hiding this comment.
I checked this - pd.Timedelta(day_offset) currently does not work
I specifically fixes the handling in to_timedelta. I can look into exetending support in the constructor as well.
Let me know if that would be preferred.
Member
|
Does this work with a list of day_offsets? |
Author
|
List-like input not handled previously, |
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.
to_timedelta#64240doc/source/whatsnew/v3.0.1.rstfile if fixing a bug or adding a new feature.AGENTS.md.Summary
My solution makes
to_timedeltacorrectly handle theDayoffset.now, when a
Dayobject is passed, it converts it into aTimedeltausing the number of days it contains.Note: AI used to track exact file location of issue and understand issue.