BrandonFors/pandas-github-issues huggingface dataset:
PERF: Allow ensure_index_from_sequence to return RangeIndex
State: closed

Discovered in https://github.com/pandas-dev/pandas/pull/57441

Builds on https://github.com/pandas-dev/pandas/pull/57752


Labels:
name: Performance
description: Memory or execution speed performance
name: Index
description: Related to the Index class or subclasses

Comments:
Any other comments here @WillAyd?
Nope all good. And thanks for the ping - sorry sometimes fall behind on notifications
DOC: Resolve RT03 errors in several methods #2 
State: closed

Resolve all RT03 errors for the following cases:
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.nsmallest
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.nunique
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.pipe
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.plot.box
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.plot.density
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.plot.kde
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.plot.scatter

- xref DOC: fix RT03 errors in docstrings  #57416
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs

Comments:
Thanks @bergnerjonas
Fix SparseDtype comparison
State: closed

- [x] closes #54770(Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Sparse
description: Sparse Data Type

Comments:
Thank you for your review. I added a whatsnew note.
Thanks @tqa236
DOC: Resolve RT03 errors for selected methods
State: closed

Resolve all RT03 errors for the following cases:

scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.expanding
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.filter
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.first_valid_index
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.last_valid_index
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.get
- xref DOC: fix RT03 errors in docstrings  #57416
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs

Comments:
Any idea why the unit tests / Numpy Dev failed? I only changed things in the docstrings not in the code itself.
Thanks @bergnerjonas
Fix rank method with nullable int
State: closed

We can't pass only `self._values_for_argsort()` to `rank` as the missing data info will be lost. Fortunately, passing `self` directly to `rank` seems to work just fine.

- [x] closes #56976 (Replace xxxx with the GitHub issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays
name: Reduction Operations
description: sum, mean, min, max, etc.

Comments:
Thank you for the review. I added the note.
Great thanks @tqa236
DOC: Clarify doc for converting timestamps to epoch
State: closed

- [x] closes #56343 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs
name: Stale

Comments:
Sorry, I was not meant to close this PR. I closed it by accident when cleaning up my fork
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
Thanks for the pull request, but it appears to have gone stale. Additionally it seems like more discussion is needed in the issue on what we actually want to include in the docs so closing for now
DOC: Fix description for pd.concat sort argument
State: closed

- [x] closes #57753 
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs

Comments:
Thanks @Wikilicious
Enforce numpydoc's GL05
State: closed

This error code was shadowed by another with the same name in `pandas`. The old error code was renamed to `PD01` in https://github.com/pandas-dev/pandas/pull/57767

I think `numpydoc`'s GL05 might also be interesting to enforce

```
    "GL05": 'Tabs found at the start of line "{line_with_tabs}", please use '
    "whitespace only",
```

Labels:
name: Docs

Comments:
Thanks @tqa236
DOC: Fix PR01 and SA01 errors in pandas.ExcelFile
State: closed

- [x] xref #57438 
- [x] xref #57417 
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs
name: IO Excel
description: read_excel, to_excel

Comments:
Thanks for the PR @iridiium - looks like docstring validation is failing here and needs fixed.
I am aware of and currently fixing the issues, sorry for requesting reviews when unneeded.
@iridiium we changed how we specify the pending errors in `code_checks.sh` and you'll have to resolve the conflicts now, sorry about it.
@iridiium if you want I can help with the updating of the error exceptions in the shell script. Just let me know
> @iridiium if you want I can help with the updating of the error exceptions in the shell script. Just let me know

~~Sorry, I've been a bit busy lately, although I will try and work on this soon. I haven't been following the changes much and am not too sure on how to update this, how would I do so?~~

I haven't changed much, so I'd rather start fresh
PERF: RangeIndex.__getitem__ with integers return RangeIndex
State: closed

Builds on #57752

Discovered in #57441

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Performance
description: Memory or execution speed performance
name: Index
description: Related to the Index class or subclasses

Comments:
This looks to have a lot of overlap with https://github.com/pandas-dev/pandas/pull/57752 - is that expected?
> This looks to have a lot of overlap with #57752 - is that expected?

Yes, this relies on some of the changes in https://github.com/pandas-dev/pandas/pull/57752
Bump ruff to latest version
State: closed

Bump `ruff` to the latest version in a separate PR because of the big formatting change.

Labels:
name: Code Style
description: Code style, linting, code_checks

Comments:
@mroeschke I wonder if it's reasonable to deprecate EX03 in favor of `ruff`'s autoformat of docstrings. 

If I understand correctly, EX03 is used to validate that a code block in a docstring follows PEP8. Currently EX03 is using `flake8` under the hood, which is no longer compatible with `ruff` (and `black`)'s 2024 style. 

In my opinion, we can just use `ruff` here. This should allow us to remove `flake8` as a dev requirement as well.


> I wonder if it's reasonable to deprecate EX03 in favor of ruff's autoformat of docstrings.

I think there's momentum towards removing EX03. We can't right now since some docstrings are dynamically generated and `flake8` is performed those in a separate job (see `scripts/validate_docstrings.py`)
@mroeschke how about adding E704 (Multiple statements on one line (def)) to the list of ignored errors for EX03? Currently there are `"--ignore=E203,E3,W503,W504,E402,E731,E128,E124"`
> how about adding E704 (Multiple statements on one line (def)) to the list of ignored errors for EX03?

If that's the code that conflict with ruff's formating, that sounds good
@mroeschke this PR should be ready for review, apart from the second commit, which is automatic, the rest are manual small fixes
Thanks @tqa236
BUG: PyArrow dtypes were not supported in the interchange protocol
State: closed

fixes a few things:

- closes #57762
- closes #57761
- closes #57664


Labels:
name: Interchange
description: Dataframe Interchange Protocol

Comments:
thanks for your review! I've updated an simplified a bit
Thanks @MarcoGorelli 
thanks both!

> keep chipping away

😄 we're getting there

I didn't set a milestone, is it OK if I backport this to 2.2.x?
@meeseeksmachine please backport to 2.2.x
@meeseeksdev backport 2.2.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 2.2.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -x -m1 710720e6555c779a6539354ebae59b1a649cebb3
```

3. You will likely have some merge/cherry-pick conflict here, fix them and commit:

```
git commit -am 'Backport PR #57764: BUG: PyArrow dtypes were not supported in the interchange protocol'
```

4. Push to a named branch:

```
git push YOURFORK 2.2.x:auto-backport-of-pr-57764-on-2.2.x
```

5. Create a PR against branch 2.2.x, I would have named this PR:

> "Backport PR #57764 on branch 2.2.x (BUG: PyArrow dtypes were not supported in the interchange protocol)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
CLN: enforce deprecation of the `method` keyword on `df.fillna`
State: closed

xref #53496

enforced deprecation of the `method` keyword on `df.fillna/ser.fillna`

Labels:
name: Clean
name: Transformations
description: e.g. cumsum, diff, rank

Comments:
I enforced deprecation of the `method` keyword on `df.fillna/ser.fillna`. We deprecated the `method` keyword on `EA.fillna` as well. Is it OK if I enforce this deprecation in separate PR?

@jbrockmendel, could you please take a look at this PR? I think CI failures are unrelated to my changes.


Thanks @natmokval 
Thanks @mroeschke for reviewing this PR.
DOC: add whatsnew for v2.2.2
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs

Comments:
> lgtm, but is removing the imports here intentional?

ruff's failing on `main`, I think just from some prs being merged in close succession
BUG: DataFrame Interchange Protocol errors on Boolean columns
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

closes #55332

~~needs rebasing onto #57764~~

Labels:
name: Interchange
description: Dataframe Interchange Protocol

Comments:
Thanks @MarcoGorelli
CLN: Enforce deprecation of passing a dict to SeriesGroupBy.agg
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

Ref: #52268

Labels:
name: Groupby
name: Clean
name: Apply
description: Apply, Aggregate, Transform, Map

Comments:
Thanks @rhshadrach
CLN: Enforce deprecation of DataFrameGroupBy.dtypes and Grouper attrs
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

Ref: #51206, #51182, and #51997

Labels:
name: Groupby
name: Clean

Comments:
Thanks @rhshadrach. Nice to see all these go!
DEPR: make_block
State: closed

- [x] closes #56815 (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Deprecate
description: Functionality to remove in pandas

Comments:
I have been working on a branch for pyarrow testing an alternative `to_pandas` implementation. I will try to finish that this week (that should then also be in time for including it in pyarrow 16.0), and then I will be able to give more concrete feedback here.
BTW I posted some comments on the issue last week: https://github.com/pandas-dev/pandas/issues/56815
@jorisvandenbossche with #58197 in are we good to move forward here?
If there are no comments I plan to merge next week
Updated, I think addressing all comments
PERF: RangeIndex.take/reindex/join with single/no value returns RangeIndex
State: closed

Discovered in https://github.com/pandas-dev/pandas/pull/57441

Labels:
name: Performance
description: Memory or execution speed performance
name: Index
description: Related to the Index class or subclasses

Comments:
Closed via https://github.com/pandas-dev/pandas/pull/57770
DOC: fixing GL08 errors for pandas.Series.dt
State: closed

Resolved GL08 error for `scripts/validate_docstrings.py --format=actions --errors=GL08 pandas.Series.dt`
xref: #57443

- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.


Labels:
name: Docs

Comments:
pre-commit.ci autofix
I'm missing something. `Series.dt` seems to already have a docstring: https://pandas.pydata.org/docs/reference/api/pandas.Series.dt.html#pandas-series-dt

You seem to be modifying the one for Index. It would be good to use the `Series.dt` as reference, the `Parameters` and `Returns` section don't make sense to me for an accessor.
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/57751/
Thanks @s1099
CI: only keep conda cache for one day
State: closed

Our conda envs are being cached, but that also means that for the dev builds (eg numpy nightly, pyarrow nightly), you don't actually get the latest version, depending on whether some other change happened in the CI setup that would invalidate the cache.

Maybe ideally we do this _only_ for those builds that test for other dev packages? 

From https://github.com/mamba-org/setup-micromamba?tab=readme-ov-file#caching  
Related issue: https://github.com/mamba-org/setup-micromamba/issues/50

Labels:
name: CI
description: Continuous Integration
name: Stale

Comments:
I would also support invalidating all caches daily (the pre-commit caches I think are the only ones that are not affected by changing the conda key). You could update this workflow's cron to daily (and rename the file) https://github.com/pandas-dev/pandas/blob/main/.github/workflows/cache-cleanup-weekly.yml 
This pull request is stale because it has been open for thirty days with no activity. Please [update](https://pandas.pydata.org/pandas-docs/stable/development/contributing.html#updating-your-pull-request) and respond to this comment if you're still interested in working on this.
This got implemented in https://github.com/pandas-dev/pandas/pull/58710 (thanks for the inspiration!) so closing
CLN: Enforce deprecation of groupby.idxmin/idxmax with skipna=False not raising
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

Ref: #54234 

In the original deprecation, I missed the case of all NA values. Opened https://github.com/pandas-dev/pandas/issues/57745 to track.

Labels:
name: Groupby
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Clean
name: Reduction Operations
description: sum, mean, min, max, etc.

Comments:
Thanks @rhshadrach
CLN: Enforce deprecation of groupby.quantile supporting bool dtype
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

Ref: #53975

Labels:
name: Groupby
name: Clean
name: quantile
description: quantile method

Comments:
Thanks @rhshadrach
CLN: Enforce deprecation get_group with tuples of length 1
State: closed

- [ ] closes #xxxx (Replace xxxx with the GitHub issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) 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.

Ref: #54155 & #50064

Labels:
name: Groupby
name: Clean

Comments:
Thanks @rhshadrach