From 036b2a5d532883d1dd07575c402e98d8504b40e5 Mon Sep 17 00:00:00 2001 From: asoledad33 Date: Mon, 6 Oct 2025 19:42:41 -0400 Subject: [PATCH 1/2] Add explict strict=True to zip() calls --- pandas/core/strings/accessor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index b9f3cd137bf82..ff3a17e4d2d5b 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -334,7 +334,7 @@ def _wrap_result( ) result = { label: ArrowExtensionArray(pa.array(res)) - for label, res in zip(name, result.T) + for label, res in zip(name, result.T, strict=True) } elif is_object_dtype(result): @@ -684,7 +684,8 @@ def cat( elif na_rep is not None and union_mask.any(): # fill NaNs with na_rep in case there are actually any NaNs all_cols = [ - np.where(nm, na_rep, col) for nm, col in zip(na_masks, all_cols) + np.where(nm, na_rep, col) + for nm, col in zip(na_masks, all_cols, strict=True) ] result = cat_safe(all_cols, sep) else: From 157a6a085966143a73aa5c581612c29f494e7a02 Mon Sep 17 00:00:00 2001 From: asoledad33 Date: Mon, 6 Oct 2025 19:43:12 -0400 Subject: [PATCH 2/2] Remove Ruff check for pandas/core/strings --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 7e17d507087e7..b570a7c1ff26c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -470,7 +470,6 @@ exclude = [ "pandas/core/reshape/merge.py" = ["B905"] "pandas/core/reshape/pivot.py" = ["B905"] "pandas/core/reshape/reshape.py" = ["B905"] -"pandas/core/strings/accessor.py" = ["B905"] "pandas/core/window/rolling.py" = ["B905"] "pandas/_testing/asserters.py" = ["B905"] "pandas/_testing/_warnings.py" = ["B905"]