BrandonFors/pandas-github-issues huggingface dataset:
CLN: use cimports for type checks
State: closed

The generated C corresponding to the cnp.integer check in is_integer_object is `__Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_5numpy_integer)` which looks to me like it goes through python-space paths, can you comment @WillAyd ?

Despite that, perf seems neutral-to-improved:

```
import numpy as np
from pandas._libs.lib import is_integer

item1 = 2
item2 = np.int64(1)
item3 = "foo"

%timeit is_integer(item1)
63.6 ns ± 1.17 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- main
62.9 ns ± 0.992 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- PR

%timeit is_integer(item2)
70.5 ns ± 2.78 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- main
68.9 ns ± 1.37 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- PR

%timeit is_integer(item3)
64.7 ns ± 2.95 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- main
61.6 ns ± 0.469 ns per loop (mean ± std. dev. of 7 runs, 10,000,000 loops each)  # <- PR
```

Also for @WillAyd: we could make similar simplifications in util.is_float_object and util.is_complex_object but that would require removing their `nogil`ness.  IIRC that was something you thought we should do regardless?

Labels:
name: Clean

Comments:
> `__Pyx_TypeCheck(__pyx_v_obj, __pyx_ptype_5numpy_integer)` which looks to me like it goes through python-space paths, can you comment @WillAyd ?

Not sure - would have to see how Pyx_Type_Check is implemented. I suppose it could just use C-level struct access, but likely defers to `PyObject_IsInstance` at some point

This PR looks great. I am of the opinion that `nogil` is not worth jumping through hoops for if we cannot measure an improvement with it
Thanks @jbrockmendel
Fix get_datetimestruct_days overflow
State: closed

More pre-cursor for UBSAN/ASAN

Labels:
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
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 @WillAyd
Refactored pandas_timedelta_to_timedeltastruct
State: closed

this mostly cuts down on copy paste, but also implements `const` where it can be done on some variables

Labels:
name: Internals
description: Related to non-user accessible pandas implementation
name: Timedelta
description: Timedelta data type
name: Stale

Comments:
Small question, otherwise looks like a nice cleanup
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.
Sorry I let this slip - this should be reviewable now
Thanks @WillAyd
create pull req
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:

Comments:
Thanks for your PR, but if you are trying to create an example pull request we recommend doing this on your own fork first. 

If your PR is designed to address an issue please include more information in the title and the PR body
CI fix ci whatsnew items
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: CI
description: Continuous Integration

Comments:
self-merging to fix ci
TST update and simplify consortium api test
State: closed

It's quite likely that the dataframe api will have a `Scalar` class, and that `Column.get_value` will return that

I'm suggesting to just simplify the test to make an assertion about `Column.name`, which realistically isn't going to change

---

Docs CI failure is unrelated and due to https://github.com/scipy/docs.scipy.org/issues/80

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Interchange
description: Dataframe Interchange Protocol

Comments:
Thanks @MarcoGorelli 
@meeseeksdev backport to 2.1.x
REF: de-duplicate freq pinning/validation
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: Refactor
description: Internal refactoring of code
name: Frequency
description: DateOffsets

Comments:
Thanks @jbrockmendel
CLN: remove unused unit argument
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: Clean

Comments:
Thanks @jbrockmendel
CLN: remove unnecessary bits from dtypes.pyx
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: Clean

Comments:
Thanks @jbrockmendel
ENH: dont hard-code nanoseconds in overflow exception message
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: Error Reporting
description: Incorrect or improved errors from pandas
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
BUG: resolution inference with NaT ints/floats/strings
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: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
BUG: Index losing object dtype for pandas object and infer string
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: Strings
description: String extension data type and string data
name: Index
description: Related to the Index class or subclasses

Comments:
Preferring the deprecation and then making it consistent at once
BUG: dt64 astype silent overflows
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).
- [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/vX.X.X.rst` file if fixing a bug or adding a new feature.

Surfaced while implementing #55564

Labels:
name: Astype
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
DEPR: rename BQ to BQE for offsets
State: closed

xref #55553, #55496, #52064

Deprecated the alias denoting business quarter end frequency  `'BQ'` for offsets in favour of `'BQE'`. 
Renamed strings 'BQ-DEC', 'BQ-JAN', etc. denoting business quarterly frequencies with various fiscal quarter ends to 'BQE-DEC', 'BQE-JAN', etc.

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

Comments:
Thank you for reviewing this PR. I will add the note to whatsnew and will remove the entries "BM", "CBM" in the next PR.
Use NumPy macros for overflow detection
State: closed


Labels:
name: Build
description: Library building on various platforms
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
Looks like the complier warnings are still appearing in the MacOS build

```bash
  [88/152] Compiling C object pandas/_libs/pandas_datetime.cpython-39-darwin.so.p/src_vendored_numpy_datetime_np_datetime.c.o
  ../../pandas/_libs/src/vendored/numpy/datetime/np_datetime.c:358:40: warning: incompatible pointer types passing 'int64_t *' (aka 'long long *') to parameter of type 'long *' [-Wincompatible-pointer-types]
    return checked_int64_sub(year, 1970, result);
```
Ah cool that's helpful to see - thanks for pointing it out
Ok think the warnings are gone now 
Thanks @WillAyd
REF: lreshape, wide_to_long
State: closed


Labels:
name: Refactor
description: Internal refactoring of code
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Going to merge, but can follow up if needed
https://asv-runner.github.io/asv-collection/pandas/#reshape.WideToLong.time_wide_to_long_big

that seems to have caused a regression

cc @mroeschke
TST: parametrize over dt64 unit
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.

Aimed at trimming the diff in #55901

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
PERF: assert_frame_equal / assert_series_equal
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.

Follow-up to #55949 addressing some of @jbrockmendel's comments and also expanding to non-multiindex cases:

```
import pandas as pd

N = 1_000_000

idx = pd._testing.makeStringIndex(N)

ser1 = pd.Series(1, index=idx.copy(deep=True))
ser2 = pd.Series(1, index=idx.copy(deep=True))

%timeit pd.testing.assert_series_equal(ser1, ser2)

# 17.8 s ± 129 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
# 48.1 ms ± 3.28 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)
```

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Performance
description: Memory or execution speed performance

Comments:
Thanks @lukemanley
DEPR: resample with PeriodIndex
State: closed

- [x] closes #53481 (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.


Labels:
name: Period
description: Period data type
name: Resample
description: resample method
name: Deprecate
description: Functionality to remove in pandas

Comments:
I am OK with this deprecation, would be good to get another yay from another core dev
If there are no more comments, I plan to merge this in a week.
Thanks @jbrockmendel
TST: Move groupby tests out of test_function
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.

The tests that remain are tests that go across reductions, transformations, and filters. The bulk of these are tests for `numeric_only`

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Groupby
name: Clean

Comments:
tests arent changed, just cut/paste?
> tests arent changed, just cut/paste?

Yea - that's right. Just a move here. Once `test_functions` is no more and `test_groupby` only has tests for the `GroupBy` instances themselves, I'm going to start trying to improve the quality of individual tests.
Thanks @rhshadrach
TST: collect date_range tests, parametrize over unit
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: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
Updates to check the dtypes instead
State: closed

- [x] closes #55897
- [ ] [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:

Comments:
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.
DEPR: PeriodIndex ordinal, fields keywords
State: closed

- [x] closes #55960 (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.


Labels:
name: Period
description: Period data type
name: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks @jbrockmendel
BUG: PeriodIndex.__new__ with keyword mismatch
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: Error Reporting
description: Incorrect or improved errors from pandas
name: Period
description: Period data type

Comments:
Thanks @jbrockmendel
BUG: astype, asfreq with non-nano
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.


Labels:
name: Non-Nano
description: datetime64/timedelta64 with non-nanosecond resolution

Comments:
Thanks @jbrockmendel
TST: split and parametrize
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
BUG: disallow how keyword in shared-ax plotting
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.

We could make this a deprecation, but im super-skeptical that anyone is passing this.

Labels:
name: Visualization
description: plotting

Comments:
Thanks @jbrockmendel
DOC: Updates typo in to_timedelta docs
State: closed

- [x] closes #55947 
- [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/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Docs
name: Timedelta
description: Timedelta data type

Comments:
Nice, thanks @lazarust for taking care of it.