-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Fix 18068: Updates merge_asof error, now outputs datatypes #18082
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
Fix 18068: Updates merge_asof error, now outputs datatypes #18082
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.
can you add a whatsnew note for 0.21.1 as well.
pandas/core/reshape/merge.py
Outdated
"must be the same type") | ||
raise MergeError("incompatible merge keys {lkdtype} and " | ||
"{rkdtype}, must be the same type" | ||
.format(lkdtype=lk.dtype, rkdtype=rk.dtype)) |
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.
might also add an enumerate here to make it even more clear, e.g.
for i, (lk, rk) in enumerate(zip(......))):
.....
raise MergeError("incompatible merge key [{i} {lkdtype} and "
@jreback Made the requested changes. I have a question though. How should I check whether release notes messages will successfully get parsed? Is there a build command to check that? |
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.
you can use tm.assert_raises_regex to assert the errors messages
pandas/core/reshape/merge.py
Outdated
if not is_dtype_equal(lk.dtype, rk.dtype): | ||
raise MergeError("incompatible merge keys, " | ||
"must be the same type") | ||
raise MergeError("incompatible merge keys [{i} {lkdtype} and " |
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}] other wise this is confusing
Codecov Report
@@ Coverage Diff @@
## master #18082 +/- ##
==========================================
- Coverage 91.25% 91.23% -0.02%
==========================================
Files 163 163
Lines 50120 50120
==========================================
- Hits 45737 45728 -9
- Misses 4383 4392 +9
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #18082 +/- ##
==========================================
- Coverage 91.25% 91.23% -0.02%
==========================================
Files 163 163
Lines 50120 50120
==========================================
- Hits 45737 45728 -9
- Misses 4383 4392 +9
Continue to review full report at Codecov.
|
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.
can you add a test which asserts this error message (e.g. use the case from the original issue)
@@ -102,7 +102,7 @@ Sparse | |||
Reshaping | |||
^^^^^^^^^ | |||
|
|||
- | |||
- Error message in ``pd.merge_asof()`` for key datatype mismatch now includes datatype of left and right key (:issue:`18068`) |
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.
can you use :func:`merge_asof`
so we get the link
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.
@jreback Is there a documentation for syntax to be used for release notes? Also, how can I view rendered version of it?
Making the required change. Also, will add test for the same.
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.
no this is fine
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.
documentation is look at similar notes!
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.
you would have to build the docs to render it
thanks @manrajgrover |
(cherry picked from commit 86e9dcc)
git diff upstream/master -u -- "*.py" | flake8 --diff