8000 Raise MergeError on mismatched signed/unsigned int merge keys by RITAMIT2023 · Pull Request #61694 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

Raise MergeError on mismatched signed/unsigned int merge keys #61694

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
Prev Previous commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jun 23, 2025
commit bc802704251fd03d0dfef647fcb918fc523fb89f
5 changes: 2 additions & 3 deletions pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,9 +1671,8 @@ def _maybe_coerce_merge_keys(self) -> None:
rk = extract_array(rk, extract_numpy=True)

# Explicitly disallow merging int64 and uint64 (or vice versa)
if (
(lk.dtype == np.dtype("int64") and rk.dtype == np.dtype("uint64"))
or (lk.dtype == np.dtype("uint64") and rk.dtype == np.dtype("int64"))
if (lk.dtype == np.dtype("int64") and rk.dtype == np.dtype("uint64")) or (
lk.dtype == np.dtype("uint64") and rk.dtype == np.dtype("int64")
):
raise ValueError(
f"You are trying to merge on int64 and uint64 columns for key '{name}'. "
Expand Down
Loading
0