Skip to content

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

Merged
merged 5 commits into from
Nov 3, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1255,8 +1255,9 @@ def _get_merge_keys(self):
# validate index types are the same
for lk, rk in zip(left_join_keys, right_join_keys):
if not is_dtype_equal(lk.dtype, rk.dtype):
raise MergeError("incompatible merge keys, "
"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))
Copy link
Contributor

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 "


# validate tolerance; must be a Timedelta if we have a DTI
if self.tolerance is not None:
Expand Down