BrandonFors/pandas-github-issues huggingface dataset:
CLN: __repr__ tests
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: Testing
description: pandas testing functions or related to the test suite
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
Thanks @jbrockmendel, nice not having random `repr/str` calls in places
Add missing dependencies for: _khash_primitive_helper
State: closed

- [ x ] closes #55615 - Add missing dependencies and one can now use `samurai` to build.

Thanks to @kaniini for helping me find where to add the dependencies.

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

Comments:
Might be overlooking it but why do these modules need this as a source? Can you provide the original error you were getting?
Thank you! Yeah, the original errors are in the issue under `Installation Logs` under `Details`, maybe I put them in the wrong section 🤣 . I did also dig deeper that has more details in this issue:
https://github.com/wolfi-dev/os/issues/7334
When building with samurai, the dependency rules are sorted after loading, while the original implementation of ninja orders the dependency rules based on when they were malloc'd.  This can result in underdefined dependencies appearing to work simply as a side effect of when the dependency rule was evaluated.

In this case, both `arrays.pyx` and `index.pyx` are pulling in `pandas._libs` via an `import` (*not* `cimport`) statement, which results in `khash.pyx` being evaluated as part of the cython generation process.  But `khash.pyx` requires generated code, so it needs to be generated before these modules so they can safely pull in `pandas._libs`.

As an aside, see #51875 which is pointing out basically the same problem.
Do these need to be listed in `sources` or can you add them as `deps`? I see a few other modules already use deps and that seems like a more natural fit
Yes, probably.  Testing it now!
Sadly, Meson reports when using `deps`:

```
../pandas/_libs/meson.build:106:7: ERROR: Argument is of an unacceptable type 'CustomTarget'.
```

So I think we need to keep it as a source due to limitations of meson.
Did you declare that dependency against `_khash_primitive_helper` or `_khash_primitive_helper_dep`? Looks like the latter is used in a few places already so would be surprised if that didn't work
Ok, phew that was easy 😆  PTAL, looking better?
I don't think the failing test is related to this PR looking at other PRs that are failing similarly?
Thanks @vaikas
BUG: mixed-type mixed-timezone/awareness
State: closed

- [x] closes #55693 (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.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Surfaced while implementing #55564.

Two implementation notes:

1) The implementation here is pretty ugly because we have to work around an existing deprecation.  I chose to avoid changing the behavior in any of the cases that currently warn.  Once that deprecation is enforced, we'll be able to simplify this quite a bit.

2) This takes a stand on #55779 for checking once at the end instead of inside the loop.

Labels:
name: Timezones
description: Timezone data dtype

Comments:
Thanks @jbrockmendel
DEPR offsets: rename ‘Y’ to ‘YE'
State: closed

- [x] closes #54275

xref #9586, #52064
Deprecated the alias denoting year end frequency “Y” for offsets in favour of “YE".

Labels:
name: Frequency
description: DateOffsets
name: Deprecate
description: Functionality to remove in pandas

Comments:
@MarcoGorelli, could you please take a look at this PR?  Looks like CI failures are unrelated to my changes (`test_dti_ambiguous_matches_timestamp` in pandas/tests/indexes/datetimes/test_constructors.py failed).
BUG: to_datetime with mixed-string-and-numeric
State: closed

- [ ] closes #xxxx (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.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Surfaced while implementing #55564

Labels:
name: Datetime
description: Datetime data dtype

Comments:
Thanks @jbrockmendel 
@jbrockmendel mind taking a look at this test failure on main? This PR _might_ have been responsible https://github.com/pandas-dev/pandas/actions/runs/6728530133/job/18288031590
will do
Reverting this doesn't seem to fix the problem, but it definitely seems connected to what ive been doing the last few days.  i'll keep trying to track this down

Thanks!
i dont think a measured-in-minutes fix is forthcoming.  might need to xfail or comment-out that offending line
List accessor
State: closed

- [ ] closes #55323(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: Nested Data
description: Data where the values are collections (lists, sets, dicts, objects, etc.).
name: Arrow
description: pyarrow functionality

Comments:
Not sure why doc string test is failing.
@mroeschke I'm not really sure how to work around the CI failure, it looks like the issue is that I'm calling _pa_array in arrow accessor which is only defined in the ArrowExtensionArray, but it's also impossible for the Series to not be backed by an ArrowExtensionArray because of the call to _validate in init.

I looked at the old code in StructAccessor and it was also accessing _pa_array directly, not sure how that one passed the check and this one doesn't. Would appreciate some guidance with this.

EDIT: look like it passing now, but I have a number of other CI failures:

       with pytest.raises(pytz.AmbiguousTimeError, match=dtstr):
>           DatetimeIndex([dtobj], tz=tz2)
E           Failed: DID NOT RAISE <class 'pytz.exceptions.AmbiguousTimeError'>

Looks unrelated.
Nice work @rohanjain101!
BUG: `DataFrame.resample` changing index type to `MultiIndex` when dataframe is empty and upsampling
State: closed

- [x] Closes #55572
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests)
- [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.1.3.rst` file


Labels:
name: MultiIndex
name: Resample
description: resample method

Comments:
@mroeschke Changelog updated.
@mroeschke Sorry for the delay. Changelog updated now.
So sorry this keeps getting missed. Could you please the whatsnew note to `2.2.1.rst`? I can merge as soon as that's made
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.
BUG: to_datetime with empty string
State: closed

- [ ] closes #xxxx (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.

Surfaced while imlpementing #55564

Labels:
name: Datetime
description: Datetime data dtype

Comments:
Thanks @jbrockmendel
BUG: OutOfBoundsDatetime with non-nano dt64tz dtype
State: closed

- [x] closes #54620 (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.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Updated version of #54620.

Progress towards #55564

Labels:
name: Timezones
description: Timezone data dtype
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
CI: Run CoW on 3.11 only
State: closed

It appears `unit-tests.yml` is spawning too many jobs so it appears CoW jobs are being canceled.

@jorisvandenbossche @phofl are you OK with only running `pandas_copy_on_write: "1"` tests on 3.11 (or another singular Python version)?

Labels:
name: CI
description: Continuous Integration

Comments:
Huh looks like the CoW job still got canceled. Maybe the number of jobs a workflow can spawn changed recently (or something else is going wrong)
> @jorisvandenbossche @phofl are you OK with only running pandas_copy_on_write: "1" tests on 3.11 (or another singular Python version)?

No CoW needs to run on all Python versions. They changed the ref count in CPython between 3.10 and 3.11 and CoW relies on this for warnings. 
OK sounds good. Closing
DOC: Fixes DataFrame.replace documentation
State: closed

- [x] closes #55570 
- [ ] [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 @jpgianfaldoni
BUG: DatetimeIndex.diff raising TypeError
State: closed

- [x] closes #55752
- [x] closes #55080 
- [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.1.3.rst` file if fixing a bug or adding a new feature.


Labels:
name: Bug
name: Index
description: Related to the Index class or subclasses

Comments:
Reclassified from regression to bug since the `Index.diff` method was only recently added in #52551 and it looks like this has been the behavior since it was added.
Thanks @lukemanley 
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.1.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 f04da3c1c9f5fd81ce7a04e55a965e4021de2ae9
```

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

```
git commit -am 'Backport PR #55761: BUG: DatetimeIndex.diff raising TypeError'
```

4. Push to a named branch:

```
git push YOURFORK 2.1.x:auto-backport-of-pr-55761-on-2.1.x
```

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

> "Backport PR #55761 on branch 2.1.x (BUG: DatetimeIndex.diff raising TypeError)"

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).
BUG: _validate_setitem_value fails to raise for PandasArray
State: closed

- [ ] closes #51044
- [ ] [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: Bug

Comments:
@hvsesha thanks you for the work with this bug. I prefer to close this PR, as you have many changes that we don't want to merge here, including breaking the PEP-8 styles, adding files with your tests, changing default arguments of existing functions...

I see it's your first contribution, what I suggest is the same:
- You look in our code base where the tests for the function with the bug are
- You add a new test that catches the error
- You open a PR with the new test
- The test will fail, and the CI will be green
- Once we reached this milestone, you implement a fix for the bug, without adding new files, or modifying the signature of existing functions unless strictly required

You can ping me at any point of this if you need help. I think doing things step by step will make things easier both for you, and for reviewers.

Also, you shouldn't open PRs directly from the `main` branch, you should create a new branch specific to this PR.
Update _core.py to show valid plot types in the Error Message for Invalid plot kind
State: closed

If an invalid plot type is passed, the error message raised is

```
raise ValueError(f"{kind} is not a valid plot kind")
```
To give more context to user, it should also show the valid plot kinds.

Labels:
name: Visualization
description: plotting
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
pre-commit.ci autofix
Thanks @ahmadmustafaanis
Clarify dtype parameter in read_excel
State: closed

Fix #55489

- [ ] 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
name: IO Excel
description: read_excel, to_excel

Comments:
Thanks @gadeatric
BUG: Index.is_monotonic... incorrectly caching Index.is_unique when first value is NaT
State: closed

- [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.0.rst` file if fixing a bug or adding a new feature.

Fixes the following:

```
In [1]: import pandas as pd

In [2]: idx = pd.to_datetime([None, "2000-01-01", "2000-01-01"])

In [3]: idx.is_unique, idx.is_monotonic_increasing
Out[3]: (False, False)

In [4]: idx = pd.to_datetime([None, "2000-01-01", "2000-01-01"])

In [5]: idx.is_monotonic_increasing, idx.is_unique
Out[5]: (False, True)
```

Labels:
name: Bug
name: Index
description: Related to the Index class or subclasses

Comments:
Thanks @lukemanley
fixed bug where pd.NA was being cast to NaN during formatting
State: closed

replaced `pd.concat` with `DataFrame.drop` to copy `pd.NA` more faithfully (see linked issue)
- [ ] closes #55630



Labels:
name: Bug
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Output-Formatting
description: __repr__ of pandas objects, to_string

Comments:
im not sure, is it normal that so many CI steps are failing? (it's my first time contributing to pandas)
> im not sure, is it normal that so many CI steps are failing? (it's my first time contributing to pandas)

Two things to do when the CI is failing: look at the failure message of (some) builds and see if the builds are passing on main. For the first, I'm seeing:

https://github.com/pandas-dev/pandas/actions/runs/6703704571/job/18214736331?pr=55754#step:4:226

> INTERNALERROR> E   ModuleNotFoundError: No module named 'numba'

This is likely not due to your PR :smile: Recent commits to main also have 4 failing.

Once you believe the failed builds are not due to your PR and you're not seeing them fail on the most recent commit to main, try merging main into this branch. It will run all the builds again.
it looks like main is having the same CI failures as here
Looks good - I think CI issues will be resolved when you merge main.
Thanks @DominiqueGarmier!
REF: collect to_string tests
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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @jbrockmendel
PERF: Timestamp construction with tz and string offset
State: closed

```
import pandas as pd

dtstr = "2016-01-01 02:03:04-07:00"
tz = "US/Pacific"

%timeit pd.Timestamp(dtstr, tz=tz)
31.6 µs ± 318 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)  # <- branch
33.5 µs ± 196 ns per loop (mean ± std. dev. of 7 runs, 10,000 loops each)  # <- main
```

Small bump from avoiding some object creation.  The underlying motivation is moving towards aligning/de-duplicating the code we use in the several places that we use string_to_dts.

Labels:
name: Performance
description: Memory or execution speed performance
name: Timestamp
description: pd.Timestamp and associated methods

Comments:
Thanks @jbrockmendel
DOC: Fix release date for 2.1.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:
Thanks @lithomas1
Add punning
State: closed

This is a draft PR illustrating the impact of the python syntactic sugar proposed in https://discuss.python.org/t/syntactic-sugar-to-encourage-use-of-named-arguments/36217/41 (PEP incoming)

This is purely for illustrative purposes and should not be merged.

**We here illustrate the impact of using the proposed syntactic sugar in all cases where it is applicable. In practice, as with any other language feature, the programmer should be judicious about whether using this feature improves their code based on the context. We do not advocate for enforcing a rule of using this feature in all cases where it may be applicable.**

Labels:

Comments:
Hi. If this is for demonstration purposes for a PEP, it would be preferable to do this on your own fork. Thanks but closing.