Skip to content

Commit fbb6511

Browse files
committed
STY: Add strict parameter with appropriate value in zip() in pandas/tests/series/methods/
1 parent b20d6ab commit fbb6511

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

pandas/tests/series/methods/test_convert_dtypes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -209,11 +209,11 @@ def test_convert_dtypes(
209209
"convert_boolean",
210210
"convert_floating",
211211
]
212-
params_dict = dict(zip(param_names, params))
212+
params_dict = dict(zip(param_names, params, strict=True))
213213

214214
expected_dtype = expected_default
215215
for spec, dtype in expected_other.items():
216-
if all(params_dict[key] is val for key, val in zip(spec[::2], spec[1::2])):
216+
if all(params_dict[key] is val for key, val in zip(spec[::2], spec[1::2], strict=False)):
217217
expected_dtype = dtype
218218
if (
219219
using_infer_string

pandas/tests/series/methods/test_rename.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ def test_rename(self, datetime_series):
2121
assert renamed.index[0] == renamer(ts.index[0])
2222

2323
# dict
24-
rename_dict = dict(zip(ts.index, renamed.index))
24+
rename_dict = dict(zip(ts.index, renamed.index, strict=True))
2525
renamed2 = ts.rename(rename_dict)
2626
tm.assert_series_equal(renamed, renamed2)
2727

pandas/tests/series/methods/test_replace.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,7 @@ def test_replace_different_int_types(self, any_int_numpy_dtype):
648648
labs = pd.Series([1, 1, 1, 0, 0, 2, 2, 2], dtype=any_int_numpy_dtype)
649649

650650
maps = pd.Series([0, 2, 1], dtype=any_int_numpy_dtype)
651-
map_dict = dict(zip(maps.values, maps.index))
651+
map_dict = dict(zip(maps.values, maps.index, strict=True))
652652

653653
result = labs.replace(map_dict)
654654
expected = labs.replace({0: 0, 2: 1, 1: 2})

pandas/tests/series/methods/test_reset_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def test_reset_index_with_drop(self):
146146
["bar", "bar", "baz", "baz", "qux", "qux", "foo", "foo"],
147147
["one", "two", "one", "two", "one", "two", "one", "two"],
148148
]
149-
tuples = zip(*arrays)
149+
tuples = zip(*arrays, strict=True)
150150
index = MultiIndex.from_tuples(tuples)
151151
data = np.random.default_rng(2).standard_normal(8)
152152
ser = Series(data, index=index)

pandas/tests/series/methods/test_sort_index.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ def test_sort_index_ascending_list(self):
186186
["one", "two", "one", "two", "one", "two", "one", "two"],
187187
[4, 3, 2, 1, 4, 3, 2, 1],
188188
]
189-
tuples = zip(*arrays)
189+
tuples = zip(*arrays, strict=True)
190190
mi = MultiIndex.from_tuples(tuples, names=["first", "second", "third"])
191191
ser = Series(range(8), index=mi)
192192

0 commit comments

Comments
 (0)