BrandonFors/pandas-github-issues huggingface dataset:
PERF: RangeIndex.insert maintains RangeIndex when empty
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:
cc @WillAyd if you have time could you help look at the ASAN / UBSAN builds? It looks like recently they have been failing with `AddressSanitizer: DEADLY SIGNAL`?
That is definitely strange. Do you know when that first started? My guess is the error is coming from something in our conftest or a third party dependency, since it looks like it happens before the test suite even begins
This commit on main looks like it was the first one to exhibit the failure (but doesn't look like these changes should have caused it?) https://github.com/pandas-dev/pandas/commit/10f31f6a242fb01fdf37f5db2e8c6f4f82f5af16
Yea that looks unrelated. Guessing it's a dependency version issue
thx @mroeschke
DOC: Pin dask/dask-expr for scale.rst
State: closed

Currently failing on main e.g. https://github.com/pandas-dev/pandas/actions/runs/8268872378/job/22622790949?pr=57812

Labels:
name: Docs
name: Dependencies
description: Required and optional dependencies

Comments:
Looks like the doc build is passing here so going to merge to get back to green
PERF: RangeIndex.argmin/argmax
State: closed

```python
In [1]: import pandas as pd

In [2]: ri = pd.RangeIndex(100_000)

In [3]: %timeit ri.argmin()
651 ns ± 8.43 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)  # PR

In [3]: %timeit ri.argmin()
19.6 µs ± 73 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)   # main
```


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

Comments:
Thanks @mroeschke
CLN: enforce deprecation of `interpolate` with object dtype
State: closed

xref #53638

enforced deprecation of `interpolate` with object dtype


Labels:
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Clean

Comments:
I enforced deprecation of `interpolate` with `object` dtype. @phofl could you please take a look at this PR? I think CI failures are unrelated to my changes.
Thanks @natmokval
CLN: Remove unused private code in sas module
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).
- [x] 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: Clean
name: IO SAS
description: SAS: read_sas

Comments:
Thanks @tqa236
DOC: Updated the returns for DataFrame.any/all to return either a Series or scalar
State: closed

#57088 
updated documentation for reflect the return types for Dataframe.any/all calls.



Labels:
name: Docs

Comments:
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/pandas-dev/pandas/57817/
@sammig6i do you mind having a look at #57682 and see if the changes here conflict with the changes there please? I think you're modifying the same exact part of the documentation, and if that's the case it's probably better to discontinue this one (feel free to provide any feedback to that PR). Thanks!
Closing, as this seems to be duplicated and stale.
CI: Fail tests on all builds for FutureWarning/DeprecationWarning from numpy or pyarrow
State: closed

I don't think we should necessarily limit this to just to nightly build of these libraries

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: CI
description: Continuous Integration

Comments:
I think this may be a a little too cumbersome to do as we test downstream libraries and introduce our own deprecations that get reflected in those test so going to close for now
PERF: Avoid np.divmod in maybe_sequence_to_range
State: closed

xref https://github.com/pandas-dev/pandas/pull/57534#issuecomment-1957832841

Made a `is_range` method (like `is_range_indexer`) that avoids a `np.divmod` operation

```python
In [1]: from pandas import *; import numpy as np
   ...: np.random.seed(123)
   ...: size = 1_000_000
   ...: ngroups = 1000
   ...: data = Series(np.random.randint(0, ngroups, size=size))
+ /opt/miniconda3/envs/pandas-dev/bin/ninja
[1/1] Generating write_version_file with a custom command

In [2]: %timeit data.groupby(data).groups
14 ms ± 552 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # PR

In [3]: %timeit data.groupby(data).groups
17.8 ms ± 84.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)  # main
```


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

Comments:
Any other feedback here @jbrockmendel @WillAyd?
BUG: improve pd.io.json_normalize
State: closed

- [x] closes #57810
- [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).
- [x] 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/v2.2.2.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: IO JSON
description: read_json, to_json, json_normalize

Comments:
@slavanorm in case you haven't seen it, your changes are making the tests fail: https://github.com/pandas-dev/pandas/actions/runs/8239141116/job/22531710877?pr=57811#step:8:53
I'm not sure about this change - the point of the `errors` argument is to ignore missing keys. Shouldn't the test case you added still create the column but with all empty data?
yes it should but it creates rows only for the dictionaries with record path.
i will edit the fixture and assertion in order to get into this case of if

This docs check is failing, and its not fixable. Wonder what should we do now 
I fixed the code, wish someone reviewed it
sorry i closed it by mistake, just reopened it
@WillAyd could you please review the code again, it's been 2 weeks i think
Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
thank you too.
now the code is obsolete vs main branch but its ok.

on second thought, the code does not actually require merging to pandas library.
it got stale because of lack of interaction. 
everything was done on my side and all requests were adressed, but were not reviewed on time. 

best regards
DOC: fix typo in `DataFrame.plot.hist` docstring
State: closed

Spot a rendering issue [here](https://pandas.pydata.org/docs/dev/reference/api/pandas.DataFrame.plot.hist.html)
![hist](https://github.com/pandas-dev/pandas/assets/47032563/16f57912-de5d-4d21-aaa5-4d3671d1cb90)


Labels:
name: Docs

Comments:
Thanks @yuanx749
Doc: Fix GL08 error for pandas.ExcelFile.book
State: closed

All GL08 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=GL08 pandas.ExcelFile.book

- [x] xref #57443
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Fix PR01 errors for melt, option_context, read_fwf, reset_option
State: closed

All PR01 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=PR01 pandas.melt
2. scripts/validate_docstrings.py --format=actions --errors=PR01 pandas.DataFrame.melt
3. scripts/validate_docstrings.py --format=actions --errors=PR01 pandas.option_context
4. scripts/validate_docstrings.py --format=actions --errors=PR01 pandas.read_fwf
5. scripts/validate_docstrings.py --format=actions --errors=PR01 pandas.reset_option

- [x] xref  #57438
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Doc: fix PR07 errors in DatetimeIndex - indexer_between_time, mean and HDFStore - append, get, put
State: closed

All PR07 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.DatetimeIndex.indexer_between_time
2. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.DatetimeIndex.mean
3. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.HDFStore.append
4. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.HDFStore.get
5. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.HDFStore.put

- [x] xref https://github.com/pandas-dev/pandas/issues/57420
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Doc: fix PR07 errors for pandas.DataFrame get, rolling, to_hdf
State: closed

All PR07 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.DataFrame.get
2. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.DataFrame.rolling
3. scripts/validate_docstrings.py --format=actions --errors=PR07 pandas.DataFrame.to_hdf

- [x] xref #57420
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Doc: fix SA01 errors for as_ordered and as_unordered
State: closed

All SA01 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.Categorical.as_ordered
2. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.Categorical.as_unordered
3. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.CategoricalIndex.as_ordered
4. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.CategoricalIndex.as_unordered
5. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.Series.cat.as_ordered
6. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.Series.cat.as_unordered

- [x] xref #57417
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Doc: fix SA01 errors for pandas.BooleanDtype and pandas.StringDtype
State: closed

All SA01 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.BooleanDtype
2. scripts/validate_docstrings.py --format=actions --errors=SA01 pandas.StringDtype

- [x]  xref  #57417
- [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: Docs

Comments:
Thanks @jordan-d-murphy
Doc: Fix RT03 errors for  read_orc, read_sas, read_spss, read_stata
State: closed

All RT03 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.read_orc
2. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.read_sas
3. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.read_spss
4. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.read_stata

- [x] xref #57416
- [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: Docs

Comments:
@mroeschke merge conflicts have been resolved 🙂
Thanks @jordan-d-murphy
BUG: #57775 Fix groupby apply in case func returns None for all groups
State: closed

- [x] closes #57775
- [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).
- [x] Added an entry in the latest `doc/source/whatsnew/v2.2.2.rst` file if fixing a bug or adding a new feature.

In case the func passed to DataFrameGroupBy.apply returns None for all groups (filtering out all groups), the original dataframe's columns and dtypes are now part of the empty result dataframe.

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

Comments:
Thanks @dontgoto
Doc: fix RT03 pandas.timedelta_range and pandas.util.hash_pandas_object
State: closed

All RT03 Errors resolved in the following cases:

1. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.timedelta_range
2. scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.util.hash_pandas_object

- [x] xref #57416
- [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: Docs

Comments:
Thanks @jordan-d-murphy
DOC: Remove RT03 docstring errors for selected methods
State: closed

Resolve all RT03 errors for the following cases:

scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.pop
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.reindex
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.reorder_levels
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.swapaxes - deprecated in favor of .transpose, which already has valid docstring
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.to_numpy
scripts/validate_docstrings.py --format=actions --errors=RT03 pandas.DataFrame.to_orc


xref DOC: fix RT03 errors in docstrings 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 issue with Tempita recompilation
State: closed

xref https://github.com/mesonbuild/meson-python/issues/589#issuecomment-1987206217 @rhshadrach I think you mentioned this originally on Slack

Labels:
name: Build
description: Library building on various platforms

Comments:
@lithomas1 - thought you might want to review.
No objections here - I think adding the files as sources was originally a hack to workaround a bug in meson.
Thanks @WillAyd 
The more I have used this the less I am sure that it actually fixed the issue. Whenever I edit a tempita file now it does _not_ trigger a recompilation as it should
Fix some typing errors
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: Typing
description: type annotations, mypy/pyright type checking

Comments:
@twoertwein thank you for your review. I addressed all the comments.
Migrate ruff config to the latest format
State: closed

Resolves these warnings (available if running `ruff` directly) and fix some formatting errors discovered in the new config that's arguably should be equivalent to the old one.

```bash
warning: The top-level linter settings are deprecated in favour of their counterparts in the `lint` section. Please update the following options in `pyproject.toml`:
  - 'ignore' -> 'lint.ignore'
  - 'select' -> 'lint.select'
  - 'typing-modules' -> 'lint.typing-modules'
  - 'unfixable' -> 'lint.unfixable'
  - 'per-file-ignores' -> 'lint.per-file-ignores'
warning: `PGH001` has been remapped to `S307`.
```

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

Comments:
Thanks @tqa236
Updated the pandas.DatetimeIndex.day_name and pandas.DatetimeIndex.month_name docstring
State: closed

-  closes #57111 partially
- All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).



Labels:

Comments:
@mroeschke not sure why the Docstring validation is failing for a particular locale. However when I tested it locally using the command,scripts/validate_docstrings.py --format=actions --errors=PR02 pandas.DatetimeIndex.month_name
it passed. Any suggestions?

Thanks for your contribution here and sorry for not responding earlier, but it appears this issue has already been addressed so closing. Happy to have your contributions toward other open issues
Small refactoring
State: closed

- [x] closes #52229(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: Refactor
description: Internal refactoring of code

Comments:
Thanks @tqa236
API: Revert 57042 - MultiIndex.names|codes|levels returns tuples
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.

Manual revert of #57042

Closes #57607

The behavior described in that issue seems quite undesirable, especially for a breaking change.

cc @mroeschke 

Labels:
name: MultiIndex

Comments:
I would be OK reverting this but would like:

1. To expose `FrozenList` in `pandas.api.typing`
2. Deprecate the `union` and `difference` methods
> I would be OK reverting this but would like:
> 
> 1. To expose `FrozenList` in `pandas.api.typing`
> 2. Deprecate the `union` and `difference` methods

Okay with doing this in a follow up? (I likely won't be able to return to this for ~1 week in any case)
> Okay with doing this in a follow up? (I likely won't be able to return to this for ~1 week in any case)

Yup that's good
> Deprecate the union and difference methods

what's the reasoning for those deprecations?
> what's the reasoning for those deprecations?

Mainly cleanup. IMO if we keep `FrozenList` and make it available as a public API, that API should be minimal
Thanks @rhshadrach