Skip to content

Commit b7018ca

Browse files
committed
Merge branch 'main' into bug-39509
2 parents 0557952 + 1efb8c3 commit b7018ca

File tree

7 files changed

+365
-110
lines changed

7 files changed

+365
-110
lines changed

pandas/_testing/_warnings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,9 @@ class for all warnings. To raise multiple types of exceptions,
110110
if isinstance(match, tuple)
111111
else (match,) * len(expected_warning)
112112
)
113-
for warning_type, warning_match in zip(expected_warning, match):
113+
for warning_type, warning_match in zip(
114+
expected_warning, match, strict=True
115+
):
114116
_assert_caught_expected_warnings(
115117
caught_warnings=w,
116118
expected_warning=warning_type,

pandas/_testing/asserters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -675,7 +675,7 @@ def _raise(left, right, err_msg) -> NoReturn:
675675
)
676676

677677
diff = 0
678-
for left_arr, right_arr in zip(left, right):
678+
for left_arr, right_arr in zip(left, right, strict=True):
679679
# count up differences
680680
if not array_equivalent(left_arr, right_arr, strict_nan=strict_nan):
681681
diff += 1
@@ -1447,7 +1447,7 @@ def assert_copy(iter1, iter2, **eql_kwargs) -> None:
14471447
the same object. (Does not check that items
14481448
in sequences are also not the same object)
14491449
"""
1450-
for elem1, elem2 in zip(iter1, iter2):
1450+
for elem1, elem2 in zip(iter1, iter2, strict=True):
14511451
assert_almost_equal(elem1, elem2, **eql_kwargs)
14521452
msg = (
14531453
f"Expected object {type(elem1)!r} and object {type(elem2)!r} to be "

pandas/core/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7627,8 +7627,8 @@ def replace(
76277627
# Operate column-wise
76287628
if self.ndim == 1:
76297629
raise ValueError(
7630-
"Series.replace cannot use dict-like to_replace "
7631-
"and non-None value"
7630+
"Series.replace cannot specify both a dict-like "
7631+
"'to_replace' and a 'value'"
76327632
)
76337633
mapping = {
76347634
col: (to_rep, value) for col, to_rep in to_replace.items()

0 commit comments

Comments
 (0)