STY: Enforce Ruff rule B905, zip-without-explicit-strict
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:
- 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 - Submit a PR adding
strict=True(orstrict=Falseif necessary) tozipcalls
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
Hello Matthew, I can work on pandas/io directory. Please assign this issue to me. Thank you.
Hey Matthew, I'll work on pandas/core/internals. Thanks!
Hi @mroeschke, I created a PR (#62446) that can help the verification of these fixes in CI.
Hi Matthew, I can work on "pandas/plotting/". Thanks!
Hi Matthew, I can work on pandas/compat directory. Thanks!
My PR for pandas/io is ready - Enforce Ruff rule B905 for pandas/io #62469
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.
I can work on pandas/core/reshape
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.
Hi! I'll work on pandas/core/groupby and pandas/core/computation. Thanks
Hi, I'll work on pandas/util and pandas/_libs
Hi. I'd like to work on pandas/core/dtypes and pandas/core/strings. Thanks
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!
Hi! I'd like to work on pandas/core/indexes! Please assign it to me, thanks
Hi, I'll work on files directly under pandas/core directory.
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!
Hi,
I would like to work on pandas/conftest.py. Thanks!
Working on pandas/core/array_algos/quantile.py in #62575
Hi @mroeschke , please review: https://github.com/pandas-dev/pandas/pull/62577
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
I'm newbie,this is my first time I contribute to OSS.I'm working on pandas\core\methods
Working on pandas/tests/series/methods in #62588
In #62589
I'm newbie,this is my first time I contribute to OSS.I'm working on
pandas\core\methods
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!
Hi, @mroeschke. May you please take a look at PR #62594 when you get the chance? Thanks!
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!
Hi, @mroeschke. May you please take a look at at PR #62605 whenever you can? Thanks.
Hi, @mroeschke. I'd like to work on pandas/_testing. Thanks!