Skip to content

Commit 900f3b1

Browse files
committed
BUG (string dtype): comparison of string column to mixed object column fails pandas-dev#60228
1 parent c4da919 commit 900f3b1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

pandas/tests/series/methods/test_compare.py

+12
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,15 @@ def test_compare_datetime64_and_string():
138138
tm.assert_series_equal(result_eq1, expected_eq)
139139
tm.assert_series_equal(result_eq2, expected_eq)
140140
tm.assert_series_equal(result_neq, expected_neq)
141+
142+
def test_comparison_string_mixed_object():
143+
pd.options.future.infer_string = True
144+
145+
ser_string = pd.Series(["a", "b"], dtype="string")
146+
ser_mixed = pd.Series([1, "b"])
147+
148+
result = ser_string == ser_mixed
149+
expected = pd.Series([False, True], dtype="boolean")
150+
tm.assert_series_equal(result, expected)
151+
152+
pd.options.future.infer_string = False

0 commit comments

Comments
 (0)