File tree 3 files changed +10
-2
lines changed
3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -538,6 +538,7 @@ Reshaping
538
538
- Bug in :func:`DataFrame.merge` in which merging using ``Index`` objects as vectors raised an Exception (:issue:`19038`)
539
539
- Bug in :func:`DataFrame.stack`, :func:`DataFrame.unstack`, :func:`Series.unstack` which were not returning subclasses (:issue:`15563`)
540
540
- Bug in timezone comparisons, manifesting as a conversion of the index to UTC in ``.concat()`` (:issue:`18523`)
541
+ - Improved error message for :func:`DataFrame.merge` when there is no common merge key (:issue:`19427`)
541
542
-
542
543
543
544
Original file line number Diff line number Diff line change 233
233
--------
234
234
merge_ordered
235
235
merge_asof
236
-
236
+ DataFrame.join
237
237
"""
238
238
239
239
# -----------------------------------------------------------------------
Original file line number Diff line number Diff line change @@ -1028,7 +1028,14 @@ def _validate_specification(self):
1028
1028
common_cols = self .left .columns .intersection (
1029
1029
self .right .columns )
1030
1030
if len (common_cols ) == 0 :
1031
- raise MergeError ('No common columns to perform merge on' )
1031
+ raise MergeError ('No common columns to perform merge on. '
1032
+ 'Merge options: right_on={ron}, '
1033
+ 'left_on={lon}, right_index={ridx}, '
1034
+ 'left_index={lidx}'
1035
+ .format (ron = self .right_on ,
1036
+ lon = self .left_on ,
1037
+ ridx = self .right_index ,
1038
+ lidx = self .left_index ))
1032
1039
if not common_cols .is_unique :
1033
1040
raise MergeError ("Data columns not unique: {common!r}"
1034
1041
.format (common = common_cols ))
You can’t perform that action at this time.
0 commit comments