BrandonFors/pandas-github-issues huggingface dataset:
REF: avoid converting input to cut if passing IntervalIndex bins
State: closed

xref https://github.com/pandas-dev/pandas/issues/47772, https://github.com/pandas-dev/pandas/issues/46218#issuecomment-1186600310

Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Interval
description: Interval data type
name: cut
description: cut, qcut
name: Stale

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 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.
REGR: fix pd.cut with datetime IntervalIndex as bins
State: closed

Closes #46218

xref https://github.com/pandas-dev/pandas/issues/46218#issuecomment-1073362376 for the actual reason that causes `cut` to fail: inside the implementation, we convert the actual timestamp data to floats (to pass to the underlying algorithm), but then when passing those values to `IntervalIndex.get_indexer`, those numeric values no longer "match" with the datetime64 interval dtype. And in theory, `get_indexer` should then fail (return -1 for not finding the target values), but until https://github.com/pandas-dev/pandas/pull/42227 this actually happily worked (and therefore also let `cut` with datetime64 interval bins work).

This PR doesn't solve the root cause (we should change the logic inside `cut` so that we don't create this mismatch in values vs bins), but it is a short-term fix of the regression. It basically reverts the (unintended, I think) behaviour change introduced by https://github.com/pandas-dev/pandas/pull/42227, but without actually reverting that PR (I am keeping the refactor introducing `_should_partial_index` of that PR, but I am only changing `_should_partial_index` itself a little bit to match better with what happened before in practice). 

I will open a separate issue about the issue in `cut` and that we should make `IntervalIndex.from_indexer` more strict. (opened -> https://github.com/pandas-dev/pandas/issues/47772)

Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: Interval
description: Interval data type
name: cut
description: cut, qcut

Comments:
> I will open a separate issue about the issue in `cut` and that we should make `IntervalIndex.from_indexer` more strict. (opened -> #47772)

is that the preferred longer term fix and this a targeted PR for backport? 
> is that the preferred longer term fix and this a targeted PR for backport?

That's indeed the preferred long term to change that behaviour, and this PR restores the behaviour for both `cut` as `IntervalIndex.get_indexer`. 
Note there is also https://github.com/pandas-dev/pandas/pull/47773 which only fixes `cut`, and something we should also do anyway. But since this PR also restores the behaviour of `get_indexer` (which is strictly speaking public), I think this one is good to include for 1.4.x, and we can then also merge  https://github.com/pandas-dev/pandas/pull/47773 for main as well.
Thanks @jorisvandenbossche merging on green
STYLE add future annotations where possible
State: closed

- [x] closes #41901 (Replace xxxx with the Github issue number)
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).


Labels:
name: Code Style
description: Code style, linting, code_checks
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @MarcoGorelli
TYP: Appender also works with properties
State: closed

Technically, `Appender` works with literally any `object` as all of them have `__doc__`.

This change helps pyright in this case https://github.com/pandas-dev/pandas/blob/bdd9314c7006611021bab2b7adf7210cd874a0c2/pandas/core/series.py#L738

Mypy still needs the ignore because it doesn't support decorating a property.

Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Hey

> Mypy still needs the ignore because it doesn't support decorating a property.

Not sure I follow - which property is being decorated?
> Not sure I follow - which property is being decorated?

This property
https://github.com/pandas-dev/pandas/blob/bdd9314c7006611021bab2b7adf7210cd874a0c2/pandas/core/series.py#L740
Thanks @twoertwein
add ignore for new mypy error 'type-var'
State: closed

A new error introduced to mypy is detected in pandas' repository. This PR adds comment to ignore that error.

> pandas (https://github.com/pandas-dev/pandas)
> + pandas/core/resample.py:208: error: A function returning TypeVar should receive at least one argument containing the same Typevar  [type-var]
> + pandas/core/resample.py:208: note: Error code "type-var" not covered by "type: ignore" comment

Reference:
https://github.com/python/mypy/pull/13166

- [ ] [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.

Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thank you @anilbey!
Sure @twoertwein, happy to help :)
TST: misplaced string array test
State: closed

Just encountered this because I wanted to add a test there for another PR. 
Those tests were moved and splitted in https://github.com/pandas-dev/pandas/pull/46136, but the "string" tests are not actually about StringArray, they are about PandasArray with string numpy dtype (`np.dtype("U")`), and thus belong with the others in `tests/arrays/numpy_`, since `tests/arrays/string_` is for StringArray

Labels:
name: Clean

Comments:
thanks @jorisvandenbossche
BUG: fix regression in Series[string] setitem setting a scalar with a mask
State: closed

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


Labels:
name: Regression
description: Functionality that used to work in a prior pandas version
name: Strings
description: String extension data type and string data

Comments:
Thanks @jorisvandenbossche
DEPR: returning tuple when grouping by a list containing single element
State: closed

- [X] closes #42795 (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).
- [x] Added an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.
- [x] Applied the removal in #47719


Labels:
name: Groupby
name: Deprecate
description: Functionality to remove in pandas

Comments:
Hello @ahmedibrhm! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:















There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-08-01 20:13:40 UTC
@rhshadrach Thanks a lot for your effort and reviews! How does it look now?
@rhshadrach How does it look now?
Thanks @ahmedibrhm! Very nice 
@ahmedibrhm this is producing a bunch of warnings in the tests.  any chance you can update the relevant tests to avoid/catch these warnings?
> @ahmedibrhm this is producing a bunch of warnings in the tests. any chance you can update the relevant tests to avoid/catch these warnings?

I think I caught a lot of them in https://github.com/pandas-dev/pandas/pull/48159
@ahmedibrhm want to make a PR enforcing this deprecation?
@jbrockmendel - I'm going to pick this up.
BUG: wide_to_long fails when stubname misses and i contains string type column
State: closed

- [x] closes #46044
- [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.
- [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: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
Thanks again @GYHHAHA
TYP: Update timestamps.pyi
State: closed


Labels:
name: Typing
description: type annotations, mypy/pyright type checking

Comments:
Thanks @hauntsaninja! I assume you use the not-yet-released mypy 0.970? When I run `python -m mypy.stubtest pandas --ignore-missing-stub --concise --mypy-config-file pyproject.toml`

I only get
```sh
error: not checking stubs due to mypy build errors:
pandas/core/indexes/base.py:7138: error: Cannot determine type of "argmin"  [has-type]
pandas/core/indexes/base.py:7150: error: Cannot determine type of "argmax"  [has-type]
pandas/core/window/rolling.py:1842: error: Unused "type: ignore" comment
pandas/core/window/rolling.py:1848: error: Unused "type: ignore" comment
```

Seems there are some type errors:
https://github.com/pandas-dev/pandas/runs/7373010497?check_suite_focus=true
I used mypy==0.960 for this, but did a couple unconventional things to get things running :-) I'll file an issue for running stubtest in CI and help get it integrated properly.

Btw, what is the relationship between the stubs in pandas-dev/pandas.git and the stubs in pandas-dev/pandas-stubs.git?
> Btw, what is the relationship between the stubs in pandas-dev/pandas.git and the stubs in pandas-dev/pandas-stubs.git?

Ideally, they should be the same (and I hope that in the future they are the same). In many cases, pandas and pandas-stubs are/will hopefully be aligned but in certain cases, it is impossible(?) to find a "good" annotation. For pandas-stubs, "good" roughly means it works for users. For pandas, "good" roughly means what is technically possible (e.g., `pd.Timestamp(float("NaN"))` returns `NaTType` or another difficult case is `__getitem__` #46616).
Thank you @hauntsaninja!
TST: Add additional test for future warning when call Series.str.cat(Series.str)
State: closed

- [x] closes #28277 (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.
- [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: Strings
description: String extension data type and string data

Comments:
Hello @xr-chen! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-07-19 00:53:48 UTC
Thanks @xr-chen
BUG: Set y-axis label, limits and ticks for a secondary y-axis (#47753)
State: closed

When passing `secondary_y=True` to a plotting function, a second axes with a
y-axis on the right side is created. Passing `ylabel`, `ylim` or `yticks` changed
these properties of the original invisible left y-axis, not the secondary
y-axis.

- [x] closes #47753 
- [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.
- [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: Visualization
description: plotting

Comments:
Thanks @StefRe
BUG: Correct numeric_only default for resample var and std
State: closed

- [x] closes #46560 (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).
- [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.

No whatsnew since this was introduced in 1.5.0. The test would have caught it but it was explicitly passing `numeric_only=lib.no_default` instead of just not passing any arg.

As far as I know, this was the last task for #46560.

Labels:
name: Bug
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Resample
description: resample method
name: Nuisance Columns
description: Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply

Comments:
Awesome work @rhshadrach! This was a herculean effort 🎉 
Thanks for all the reviews @mroeschke!
FIX: PeriodIndex json roundtrip
State: closed

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


Labels:
name: IO JSON
description: read_json, to_json, json_normalize
name: Period
description: Period data type

Comments:
Hello @jmg-duarte! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:





There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-07-18 20:03:10 UTC
Thanks @jmg-duarte
ENH/TST: Add quantile & mode tests for ArrowExtensionArray
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).



Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Arrow
description: pyarrow functionality

Comments:
32-bit test failing?
> 32-bit test failing?

Unrelated, but addressed at https://github.com/pandas-dev/pandas/pull/47803
can u rebase
Rebased
DOC: Clarify return type cases in pandas.unique
State: closed

- [ ] closes #47426
- [ ] [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:
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. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.
DOC: Clarify return type cases in pandas.unique
State: closed

- [ ] closes #47426
- [ ] [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:
Hello @mitlabence! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:

* In the file [`pandas/core/algorithms.py`](https://github.com/pandas-dev/pandas/blob/a13d55215d9bc8c7e971356c1946aa25ae032f18/pandas/core/algorithms.py):

> [Line 336:61](https://github.com/pandas-dev/pandas/blob/a13d55215d9bc8c7e971356c1946aa25ae032f18/pandas/core/algorithms.py#L336): [W291](https://duckduckgo.com/?q=pep8%20W291) trailing whitespace
DEPR: deprecate pandas.tests
State: closed

- [x] closes #46651
- [ ] [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] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Not sure how to test this. All of the following imports trigger the warning (DeprecationWarning is by default not enabled, which hopefully doesn't spam the CI):
```sh
python -W default -c "from pandas import tests"
python -W default -c "from pandas.tests.frame import common"
python -W default -c "import pandas.tests.frame.common"
```


Labels:

Comments:
Hello @twoertwein! Thanks for updating this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:







There are currently no PEP 8 issues detected in this Pull Request. Cheers! :beers: 

##### Comment last updated at 2022-07-16 18:27:17 UTC
> Could be tested by running that python command in a subprocess and inspecting stdout?

I added such a test case but for some reason, it doesn't trigger the warning. I don't know why.
TST: add test for last() on dataframe grouped by on boolean column (#46409)
State: closed

- [x] closes #46409
- [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: Testing
description: pandas testing functions or related to the test suite

Comments:
Thanks @kapiliyer
BUG: groupby.corrwith fails with axis=1 and other=df
State: closed

- [x] closes #47723
- [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).

Since this one is only confirmed on master, whatsnew ommited.

Labels:
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations

Comments:
Thanks @GYHHAHA!
ENH/TST: Add Reduction tests for ArrowExtensionArray
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).


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Arrow
description: pyarrow functionality

Comments:
32-bit tests ok?
> 32-bit tests ok?

Yeah unrelated, but addressed at https://github.com/pandas-dev/pandas/pull/47803
DOC: update min package versions in install.rst to align with v.1.5.0 requirements
State: closed

Documentation update: should be part of the 1.5 milestone
Closes #47740 

Makes the min package versions in `doc/source/install.rst` consistent with those recommended in [`doc/source/whatsnew/v1.5.0.rst`.](https://github.com/pandas-dev/pandas/blob/main/doc/source/whatsnew/v1.5.0.rst#increased-minimum-versions-for-dependencies)

If this is not done, there will be a mistmatch in optional library recommendations between the release notes and the  documentation.

<img width="524" alt="image" src="https://user-images.githubusercontent.com/23153616/179132443-da09ff46-b6a4-4baf-83f0-ef5716cb7d54.png">



Labels:
name: Docs

Comments:
Looks like the doc build failed. Maybe some column alignment failed
Awesome, thanks for the cleanup @JMBurley
BUG: numeric_only with axis=1 in DataFrame.corrwith and DataFrameGroupBy.cummin/max
State: closed

Part of #46560
- [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.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

No whatsnew note as these methods gained numeric_ony in 1.5.0

Labels:
name: Bug
name: Groupby
name: Nuisance Columns
description: Identifying/Dropping nuisance columns in reductions, groupby.add, DataFrame.apply

Comments:
Thanks @rhshadrach