Skip to content

Commit 65f8b54

Browse files
update indexing tests
1 parent cc7ebe4 commit 65f8b54

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pandas/tests/indexing/test_coercion.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -856,7 +856,7 @@ def test_replace_series(self, how, to_key, from_key, replacer, using_infer_strin
856856
else:
857857
exp = pd.Series(self.rep[to_key], index=index, name="yyy")
858858

859-
if using_infer_string and exp.dtype == "string" and obj.dtype == object:
859+
if using_infer_string and exp.dtype == "string":
860860
# with infer_string, we disable the deprecated downcasting behavior
861861
exp = exp.astype(object)
862862

@@ -889,8 +889,9 @@ def test_replace_series_datetime_tz(
889889
assert obj.dtype == from_key
890890

891891
exp = pd.Series(self.rep[to_key], index=index, name="yyy")
892-
if using_infer_string and to_key == "object":
893-
assert exp.dtype == "string"
892+
if using_infer_string and exp.dtype == "string":
893+
# with infer_string, we disable the deprecated downcasting behavior
894+
exp = exp.astype(object)
894895
else:
895896
assert exp.dtype == to_key
896897

0 commit comments

Comments
 (0)