Skip to content

Commit 02dab46

Browse files
committed
BUG: raise MergeError when both right_on and right_index are specified
1 parent 4450eda commit 02dab46

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/core/reshape/merge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1928,10 +1928,10 @@ def _validate_left_right_on(self, left_on, right_on):
19281928
)
19291929
if not self.right_index and right_on is None:
19301930
raise MergeError('Must pass "right_on" OR "right_index".')
1931-
# if self.right_index and right_on is not None:
1932-
# raise MergeError(
1933-
# 'Can only pass argument "right_on" OR "right_index" not both.'
1934-
# )
1931+
if self.right_index and right_on is not None:
1932+
raise MergeError(
1933+
'Can only pass argument "right_on" OR "right_index" not both.'
1934+
)
19351935
n = len(left_on)
19361936
if self.right_index:
19371937
if len(left_on) != self.right.index.nlevels:

0 commit comments

Comments
 (0)