Skip to content

Conversation

LirongMa
Copy link

@LirongMa LirongMa commented Sep 26, 2025

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

Copy link
Contributor

@Alvaro-Kothe Alvaro-Kothe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should fix the problem.

Also, remove the files you modified from pyproject.toml.

pandas/pyproject.toml

Lines 435 to 438 in 179258f

# TODO: Fix B905 (zip-without-explicit-strict) - Remove files below as they're fixed
# For contributors working on this issue:
# After adding strict={True,False} to zip() calls in a file,
# remove its line from this section

clean_dtypes = self._clean_mapping(self.dtype)

if self.index_names is not None:
names: Iterable = self.index_names
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
names: Iterable = self.index_names
names: Iterable = self.index_names
strict = True

if self.index_names is not None:
names: Iterable = self.index_names
else:
names = itertools.cycle([None])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
names = itertools.cycle([None])
names = itertools.cycle([None])
strict = False

else:
names = itertools.cycle([None])
for i, (arr, name) in enumerate(zip(index, names)):
for i, (arr, name) in enumerate(zip(index, names, strict=True)):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for i, (arr, name) in enumerate(zip(index, names, strict=True)):
for i, (arr, name) in enumerate(zip(index, names, strict=strict)):

shivamvishal added a commit to shivamvishal/pandas that referenced this pull request Sep 27, 2025
@LirongMa LirongMa changed the title Zip Strict for pandas/io [Issue #62434] - Enforce Ruff rule B905, zip-without-explicit-strict for pandas/io Sep 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants