Skip to content

Commit

Permalink
update indexing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jorisvandenbossche committed Dec 22, 2024
1 parent cc7ebe4 commit 65f8b54
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandas/tests/indexing/test_coercion.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,7 +856,7 @@ def test_replace_series(self, how, to_key, from_key, replacer, using_infer_strin
else:
exp = pd.Series(self.rep[to_key], index=index, name="yyy")

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

Expand Down Expand Up @@ -889,8 +889,9 @@ def test_replace_series_datetime_tz(
assert obj.dtype == from_key

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

Expand Down

0 comments on commit 65f8b54

Please sign in to comment.