pandas icon indicating copy to clipboard operation
pandas copied to clipboard

STY: Enforce Ruff rule B905, zip-without-explicit-strict

Open mroeschke opened this issue 3 months ago • 58 comments

zip calls should ideally specify strict=True since most of the time there's an underlying assumption that the input arguments are of equal length. To enforce this we should enable the Ruff rule zip-without-explicit-strict, https://docs.astral.sh/ruff/rules/zip-without-explicit-strict/

Since there are about ~500 occurrences of zip in the code base, this issue should be completed in multiple PRs that adds strict=True to zip calls in a particular directory. Therefore, this issue can be worked on by multiple contributors.

For those interested in working on this issue:

  1. Comment below on which directory you'll be working on. If you want to work on pandas/core, please choose a subdirectory in this location e.g. pandas/core/internals
  2. Submit a PR adding strict=True (or strict=False if necessary) to zip calls

Once all zip calls are have a strict argument, a separate PR will be needed to move "B905" from the ignore section to the select section. https://github.com/pandas-dev/pandas/blob/98c9c7f838d223e66f1459fab23ac178b29c2227/pyproject.toml#L395

mroeschke avatar Sep 24 '25 17:09 mroeschke

Hello Matthew, I can work on pandas/io directory. Please assign this issue to me. Thank you.

LirongMa avatar Sep 24 '25 22:09 LirongMa

Hey Matthew, I'll work on pandas/core/internals. Thanks!

anthonyspeicher avatar Sep 25 '25 04:09 anthonyspeicher

Hi @mroeschke, I created a PR (#62446) that can help the verification of these fixes in CI.

Alvaro-Kothe avatar Sep 25 '25 12:09 Alvaro-Kothe

Hi Matthew, I can work on "pandas/plotting/". Thanks!

shivamvishal avatar Sep 26 '25 15:09 shivamvishal

Hi Matthew, I can work on pandas/compat directory. Thanks!

Sayeem3051 avatar Sep 26 '25 17:09 Sayeem3051

My PR for pandas/io is ready - Enforce Ruff rule B905 for pandas/io #62469

LirongMa avatar Sep 26 '25 20:09 LirongMa

Hi @mroeschke, Please review My PR for pandas/plotting : https://github.com/pandas-dev/pandas/pull/62478 I have kept the zip strict policy just flexible enough that all the tests passes.

Not sure why docstring validations are failing. But rest of the tests are passing.

shivamvishal avatar Sep 27 '25 15:09 shivamvishal

I can work on pandas/core/reshape

jsngn avatar Sep 27 '25 20:09 jsngn

Hi I’ll work on pandas/core/arrays. I’ll add explicit strict= to all zip() calls there per Ruff rule B905 and open a PR shortly.

CODEBRAKERBOYY avatar Sep 29 '25 06:09 CODEBRAKERBOYY

Hi! I'll work on pandas/core/groupby and pandas/core/computation. Thanks

floura-angel avatar Sep 29 '25 12:09 floura-angel

Hi, I'll work on pandas/util and pandas/_libs

shivamvishal avatar Sep 29 '25 13:09 shivamvishal

Hi. I'd like to work on pandas/core/dtypes and pandas/core/strings. Thanks

asoledad33 avatar Oct 01 '25 00:10 asoledad33

Hi! I would like to work on pandas/core/window for this issue. Please assign it to me. I am a first-time contributor. Thank you!

RAAPPO avatar Oct 01 '25 08:10 RAAPPO

Hi! I'd like to work on pandas/core/indexes! Please assign it to me, thanks

krishna-datta avatar Oct 01 '25 15:10 krishna-datta

Hi, I'll work on files directly under pandas/core directory.

shivamvishal avatar Oct 02 '25 21:10 shivamvishal

Hi,

I would like to work on the following directories for the Ruff B905 issue:

  • pandas/core/frame
  • pandas/tests

Please assign these to me. Thank you!

RAAPPO avatar Oct 03 '25 03:10 RAAPPO

Hi,

I would like to work on pandas/conftest.py. Thanks!

natianyudi avatar Oct 03 '25 20:10 natianyudi

Working on pandas/core/array_algos/quantile.py in #62575

GKK-Hub avatar Oct 04 '25 10:10 GKK-Hub

Hi @mroeschke , please review: https://github.com/pandas-dev/pandas/pull/62577

shivamvishal avatar Oct 04 '25 13:10 shivamvishal

Hey @mroeschke ,

I will work on pandas/core/arrays. Please assign those to me.

Thanks!

Working on pandas\tests\io\test_orc.py in #62587

GKK-Hub avatar Oct 05 '25 07:10 GKK-Hub

I'm newbie,this is my first time I contribute to OSS.I'm working on pandas\core\methods

invain01 avatar Oct 05 '25 09:10 invain01

Working on pandas/tests/series/methods in #62588

GKK-Hub avatar Oct 05 '25 09:10 GKK-Hub

In #62589

I'm newbie,this is my first time I contribute to OSS.I'm working on pandas\core\methods

invain01 avatar Oct 05 '25 11:10 invain01

Hi @mroeschke, I've submitted PR #62591 to add strict=True to zip calls in pandas/_config/.

The directory has 2 occurrences of zip() which I've updated. Thanks!

G26karthik avatar Oct 05 '25 17:10 G26karthik

Hi, @mroeschke. May you please take a look at PR #62594 when you get the chance? Thanks!

asoledad33 avatar Oct 05 '25 21:10 asoledad33

Hey @mroeschke ,

Could you take a look at PR #62596 when you get a chance?

Thanks!

Hi Matthew, I’d like to work on pandas/tests/indexes for this issue. Thanks!

Abe016 avatar Oct 06 '25 22:10 Abe016

Hi, @mroeschke. May you please take a look at at PR #62605 whenever you can? Thanks.

asoledad33 avatar Oct 06 '25 23:10 asoledad33

Hi, @mroeschke. I'd like to work on pandas/_testing. Thanks!

BreezeLune avatar Oct 08 '25 14:10 BreezeLune