-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
ENH: clearer error msg for unequal categoricals in merge_asof (GH#26136) #26242
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
ENH: clearer error msg for unequal categoricals in merge_asof (GH#26136) #26242
Conversation
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.
Do we have a test for this that ensures this works when they are "equal"?
Codecov Report
@@ Coverage Diff @@
## master #26242 +/- ##
==========================================
- Coverage 91.97% 91.96% -0.01%
==========================================
Files 175 175
Lines 52368 52371 +3
==========================================
Hits 48164 48164
- Misses 4204 4207 +3
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #26242 +/- ##
==========================================
+ Coverage 91.97% 91.97% +<.01%
==========================================
Files 175 175
Lines 52368 52389 +21
==========================================
+ Hits 48164 48184 +20
- Misses 4204 4205 +1
Continue to review full report at Codecov.
|
Good question, actually. Yes, there is. It's |
Thanks for clarifying. So this change does introduce unordered Categoricals which might be counter to what merge_asof is supposed to offer (the docstring explicitly states the join field must be ordered). Do you you see any other instances of that method supporting unordered data? Wondering if we need to further require that Categoricals are ordered to use this method |
@WillAyd Indeed, the merge keys should be ordered, otherwise I've also added code to raise a MergeError (instead of a ValueError further down the road). But maybe adding this error check in in Is there a reliable way to skip over the |
Hmm that's unfortunate. If it makes things too complicated I'm not against looking that in more detail as a follow up if you can open an issue for it |
Cool. I've reverted the last change, and added a comment to explain what's happening currently. I've created #26249 for the other cleanups. |
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.
Thanks for opening an issue for follow ups. I'm OK with this as is with cleanups to follow. Over to @jreback
thanks @chrish42 nice patch! |
git diff upstream/master -u -- "*.py" | flake8 --diff