Skip to content

Commit 7f28fc9

Browse files
asoledad33Justine Wezenaar
authored andcommitted
Zip strict strings (pandas-dev#62605)
1 parent 5038892 commit 7f28fc9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

pandas/core/strings/accessor.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def _wrap_result(
334334
)
335335
result = {
336336
label: ArrowExtensionArray(pa.array(res))
337-
for label, res in zip(name, result.T)
337+
for label, res in zip(name, result.T, strict=True)
338338
}
339339
elif is_object_dtype(result):
340340

@@ -684,7 +684,8 @@ def cat(
684684
elif na_rep is not None and union_mask.any():
685685
# fill NaNs with na_rep in case there are actually any NaNs
686686
all_cols = [
687-
np.where(nm, na_rep, col) for nm, col in zip(na_masks, all_cols)
687+
np.where(nm, na_rep, col)
688+
for nm, col in zip(na_masks, all_cols, strict=True)
688689
]
689690
result = cat_safe(all_cols, sep)
690691
else:

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ exclude = [
461461
"pandas/core/reshape/merge.py" = ["B905"]
462462
"pandas/core/reshape/pivot.py" = ["B905"]
463463
"pandas/core/reshape/reshape.py" = ["B905"]
464-
"pandas/core/strings/accessor.py" = ["B905"]
465464
"pandas/core/window/rolling.py" = ["B905"]
466465
"pandas/_testing/asserters.py" = ["B905"]
467466
"pandas/_testing/_warnings.py" = ["B905"]

0 commit comments

Comments
 (0)