-
-
Notifications
You must be signed in to change notification settings - Fork 19k
[Issue #62434] - Enforce Ruff rule B905, zip-without-explicit-strict for pandas/io #62469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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.
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
names = itertools.cycle([None]) | |
names = itertools.cycle([None]) | |
strict = False |
pandas/io/parsers/base_parser.py
Outdated
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)): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for i, (arr, name) in enumerate(zip(index, names, strict=True)): | |
for i, (arr, name) in enumerate(zip(index, names, strict=strict)): |
doc/source/whatsnew/vX.X.X.rst
file if fixing a bug or adding a new feature.