Skip to content

Commit 07b5776

Browse files
committed
updated compare error message format
1 parent 3b1315b commit 07b5776

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

pandas/core/ops/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ def to_series(right):
313313
left, right = left.align(right, join="outer", level=level, copy=False)
314314
else:
315315
raise ValueError(
316-
"Can only compare identically-labeled (both index and columns)"
316+
"Can only compare identically-labeled (both index and columns) "
317317
"DataFrame objects"
318318
)
319319
elif isinstance(right, ABCSeries):

pandas/tests/frame/methods/test_compare.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def test_compare_multi_index(align_axis):
171171
def test_compare_unaligned_objects():
172172
# test DataFrames with different indices
173173
msg = (
174-
"Can only compare identically-labeled (both index and columns) DataFrame"
174+
"Can only compare identically-labeled (both index and columns) DataFrame "
175175
"objects"
176176
)
177177
with pytest.raises(ValueError, match=msg):
@@ -181,7 +181,7 @@ def test_compare_unaligned_objects():
181181

182182
# test DataFrames with different shapes
183183
msg = (
184-
"Can only compare identically-labeled (both index and columns) DataFrame"
184+
"Can only compare identically-labeled (both index and columns) DataFrame "
185185
"objects"
186186
)
187187
with pytest.raises(ValueError, match=msg):

pandas/tests/frame/test_arithmetic.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,7 @@ def test_comparisons(self, simple_frame, float_frame, func):
15371537
tm.assert_numpy_array_equal(result3.values, func(float_frame.values, 0))
15381538

15391539
msg = (
1540-
"Can only compare identically-labeled (both index and columns)"
1540+
"Can only compare identically-labeled (both index and columns) "
15411541
"DataFrame objects"
15421542
)
15431543
with pytest.raises(ValueError, match=msg):

pandas/tests/frame/test_nonunique_indexes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def test_dup_columns_comparisons(self):
204204

205205
# not-comparing like-labelled
206206
msg = (
207-
"Can only compare identically-labeled (both index and columns)"
207+
"Can only compare identically-labeled (both index and columns) "
208208
"DataFrame objects"
209209
)
210210
with pytest.raises(ValueError, match=msg):

pandas/tests/series/test_arithmetic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -627,14 +627,14 @@ def test_comp_ops_df_compat(self, left, right, frame_or_series):
627627
# GH 50083 to clarify that index and columns must be identically labeled
628628
if frame_or_series is not Series:
629629
msg = (
630-
f"Can only compare identically-labeled (both index and columns)"
630+
f"Can only compare identically-labeled (both index and columns) "
631631
f"{frame_or_series.__name__} objects"
632632
)
633633
left = left.to_frame()
634634
right = right.to_frame()
635635
else:
636636
msg = (
637-
f"Can only compare identically-labeled {frame_or_series.__name__}"
637+
f"Can only compare identically-labeled {frame_or_series.__name__} "
638638
f"objects"
639639
)
640640
with pytest.raises(ValueError, match=msg):

0 commit comments

Comments
 (0)