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.
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
issue #27642 - timedelta merge asof with tolerance #27650
issue #27642 - timedelta merge asof with tolerance #27650
Changes from 2 commits
533d407
431da66
c9acc09
76f6525
fd1dbb2
63b7a2b
84759ac
04c18e9
ac76918
0a0c5c8
a26bb71
a0ba5d9
e5456ac
4f56dc4
52193a4
7c004c9
3f8bf2b
8f8aeb3
f66fce4
0eb173f
4a1c515
6daf823
3688986
f6009ca
6f7151d
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 should probably be
if not isinstance(self.tolerance, datetime.timedelta)
so users can passdatetime.timedelta
objects. If you could add a test case for that situation that'd be great.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.
see commit "mroeschke: this test is for you 🚀"
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 test fails
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.
I think we'll need a different PR for this test I think, it fails at this conversion check.
pandas/pandas/core/reshape/merge.py
Lines 1704 to 1710 in 143bc34
With tolerance = datetime.timedelta -> ERROR: has no attribute "value"
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.
datetime.timedelta
objects do not have nanoseconds likepd.Timedelta
Another check and conversion is necessary to convert
datetime.timedelta
correctly to nanoseconds similarly topd.Timedelta.value
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.
Okay thanks for investigating. Yes, I'd be great to address in another issues/PR.