From a5c6dcf73c3fb26cfc0da6b324d8cc47dec4b149 Mon Sep 17 00:00:00 2001 From: natianyudi Date: Sun, 12 Oct 2025 21:50:38 -0400 Subject: [PATCH 1/3] Enforce ruff rule b905 on contest.py --- pandas/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index d69c7e0113310..2a5e4c05bb77e 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -689,7 +689,7 @@ def _create_mi_with_dt64tz_level(): "categorical": CategoricalIndex(list("abcd") * 2), "interval": IntervalIndex.from_breaks(np.linspace(0, 100, num=11)), "empty": Index([]), - "tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3])), + "tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3], strict=True)), "mi-with-dt64tz-level": _create_mi_with_dt64tz_level(), "multi": _create_multiindex(), "repeats": Index([0, 0, 1, 1, 2, 2]), @@ -1874,7 +1874,7 @@ def any_numeric_dtype(request): ("period", [Period(2013), pd.NaT, Period(2018)]), ("interval", [Interval(0, 1), np.nan, Interval(0, 2)]), ] -ids, _ = zip(*_any_skipna_inferred_dtype) # use inferred type as fixture-id +ids, _ = zip(*_any_skipna_inferred_dtype, strict=False) # use inferred type as fixture-id @pytest.fixture(params=_any_skipna_inferred_dtype, ids=ids) From 876208d983f5eab13adaa3a67c7763045d7108c8 Mon Sep 17 00:00:00 2001 From: Janice Peng Date: Wed, 15 Oct 2025 12:44:15 -0400 Subject: [PATCH 2/3] Fix format --- pandas/conftest.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 2a5e4c05bb77e..5aff9465fdd04 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -689,7 +689,9 @@ def _create_mi_with_dt64tz_level(): "categorical": CategoricalIndex(list("abcd") * 2), "interval": IntervalIndex.from_breaks(np.linspace(0, 100, num=11)), "empty": Index([]), - "tuples": MultiIndex.from_tuples(zip(["foo", "bar", "baz"], [1, 2, 3], strict=True)), + "tuples": MultiIndex.from_tuples( + zip(["foo", "bar", "baz"], [1, 2, 3], strict=True) + ), "mi-with-dt64tz-level": _create_mi_with_dt64tz_level(), "multi": _create_multiindex(), "repeats": Index([0, 0, 1, 1, 2, 2]), @@ -1874,7 +1876,9 @@ def any_numeric_dtype(request): ("period", [Period(2013), pd.NaT, Period(2018)]), ("interval", [Interval(0, 1), np.nan, Interval(0, 2)]), ] -ids, _ = zip(*_any_skipna_inferred_dtype, strict=False) # use inferred type as fixture-id +ids, _ = zip( + *_any_skipna_inferred_dtype, strict=False +) # use inferred type as fixture-id @pytest.fixture(params=_any_skipna_inferred_dtype, ids=ids) From 1b638bd79b882362547bf82b537c7b79062cd1d7 Mon Sep 17 00:00:00 2001 From: Janice Peng Date: Wed, 15 Oct 2025 22:18:59 -0400 Subject: [PATCH 3/3] replace zip with cleaner code --- pandas/conftest.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pandas/conftest.py b/pandas/conftest.py index 5aff9465fdd04..ec1c81d6350c6 100644 --- a/pandas/conftest.py +++ b/pandas/conftest.py @@ -1876,9 +1876,9 @@ def any_numeric_dtype(request): ("period", [Period(2013), pd.NaT, Period(2018)]), ("interval", [Interval(0, 1), np.nan, Interval(0, 2)]), ] -ids, _ = zip( - *_any_skipna_inferred_dtype, strict=False -) # use inferred type as fixture-id +ids = [ + pair[0] for pair in _any_skipna_inferred_dtype +] # use inferred type as fixture-id @pytest.fixture(params=_any_skipna_inferred_dtype, ids=ids)