Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

STY: ruff-format reformat for frame.py #62554

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

Open
RAAPPO wants to merge 3 commits into pandas-dev:main
base: main
Choose a base branch
Loading
from RAAPPO:enforce-ruff-b905-core-frame

Conversation

Copy link
Contributor

@RAAPPO RAAPPO commented Oct 3, 2025
edited
Loading

Part of #62434

This PR enforces Ruff rule B905 (zip-without-explicit-strict) by adding explicit strict=True to all zip() calls in pandas/core/frame.py.

Updates made:

  • Updated zip(self.index, self.values) to zip(self.index, self.values, strict=True)
  • Updated zip(*arrays) to zip(*arrays, strict=True)
  • Updated zip(key, value.columns) to zip(key, value.columns, strict=False)
  • Updated zip(cols, cols_droplevel) to zip(cols, cols_droplevel, strict=True)
  • Updated zip(reversed(self.index.levels), reversed(self.index.codes)) to zip(reversed(self.index.levels), reversed(self.index.codes), strict=True)
  • Updated zip(*map(f, vals)) to zip(*map(f, vals), strict=True)
  • Updated zip(keys, by) to zip(keys, by, strict=True)
  • Updated zip(self._iter_column_arrays(), right) to zip(self._iter_column_arrays(), right, strict=True)
  • Updated zip(left.values.T, right.values.T) to zip(left.values.T, right.values.T, strict=True)

Checklist:

  • Part of STY: Enforce Ruff rule B905, zip-without-explicit-strict #62434
  • All code checks passed.
  • Tests added and passed if fixing a bug or adding a new feature.
  • 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.

Please let me know if any changes are needed!

@RAAPPO RAAPPO marked this pull request as ready for review October 3, 2025 04:51
if isinstance(value, DataFrame):
check_key_length(self.columns, key, value)
for k1, k2 in zip(key, value.columns):
for k1, k2 in zip(key, value.columns, strict=False):
Copy link
Member

@mroeschke mroeschke Oct 3, 2025

Choose a reason for hiding this comment

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

Why is this one False?

@mroeschke mroeschke added the Code Style Code style, linting, code_checks label Oct 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@mroeschke mroeschke mroeschke left review comments

Assignees
No one assigned
Labels
Code Style Code style, linting, code_checks
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /