BrandonFors/pandas-github-issues huggingface dataset:
DEPR: enforce a bunch
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: Deprecate
description: Functionality to remove in pandas

Comments:
@MarcoGorelli pls advise on the pylint failures, not clear if they are actionable
probably not, do you want to add `c-extension-no-member` to

https://github.com/pandas-dev/pandas/blob/1d8922e20b3384d56551646dfbae2f4c4e458da0/pyproject.toml#L60-L78

alongside this PR?
> pandas/core/frame.py:688:12: R1720: Unnecessary "else" after "raise", remove the "else" and de-indent the code inside it (no-else-raise)

Will this check start showing up in the pre-commit soon?  Otherwise let's get rid of it.  (and even if yes, im not a fan)
yeah happy to get rid of it if you like - I'm glad that some of these pylint checks are helping find issue (like https://github.com/pandas-dev/pandas/pull/49382#pullrequestreview-1169896308), but others `no-else-raise` does seem nitpicky

EDIT: will review the rest of the PR this afternoon
Thanks @jbrockmendel
DEPR: Enforce deprecation of numeric_only=None in DataFrame aggregations
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
- [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: Deprecate
description: Functionality to remove in pandas
name: DataFrame
description: DataFrame data structure
name: Reduction Operations
description: sum, mean, min, max, etc.

Comments:
looks like some frame reductions tests are failing
> looks like some frame reductions tests are failing

Thanks @jbrockmendel - this got a bit tricky. When the input is numeric but has object dtype, axis=1, and numeric_only=False, in 1.5.x the result is object dtype. When numeric_only=None however, the result is float. I think this behavior originated from #676. It seems odd, but I think a very rare case. I opted to go to with the 1.5.x default (numeric_only=None) behavior here and put a line in the whatsnew. If that looks good, I can open an issue on this for followup.

Also, when working on these fixes, I realized I missed generic.py / series.py for this deprecation. Went unnoticed because `None` is falsey.
needs rebase, otherwise LGTM
Thanks @rhshadrach 
nice!
REF: remove unreachable maybe_cast_to_datetime cases
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

Comments:
Thanks @jbrockmendel
CLN: Remove unused code in Factorizer classes
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.

Saw this when working on ea dtypes in merge

Labels:
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff
name: Clean

Comments:
Thanks @phofl
CI: Fix wheel builder uploading
State: closed

The uploading has been broken on nightly wheels for a while.

Hopefully, this fixes it. I've tested on my fork with a dummy token.

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

Comments:
> I'm not aware of the anaconda channel adding any value, but I've seen it causing issues when mixed with conda-forge.

In this case, anaconda publishes the anaconda-client to the anaconda channel. The conda-forge version of the client is several versions out of date unfortunately :( .

I'm going to merge this now to test that this works.
Ah, ok, makes sense then.
It works! https://github.com/pandas-dev/pandas/actions/runs/3404407427
TYP: Series.groupby
State: closed

- [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.

similar to #47560

Change `level` typing from `Level` to `IndexLabel`. 

For reference, here are the definitions:
```
IndexLabel = Union[Hashable, Sequence[Hashable]]
Level = Hashable
```



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

Comments:
Thanks @lukemanley.
BUG: NumericIndex.astype(complex) should return Index[complex]
State: closed

Working towards #42717 I discovered as small bug in `Index.astype`, where the returned class is wrong.

xref #49494.


Labels:
name: Dtype Conversions
description: Unexpected or buggy dtype conversions
name: Index
description: Related to the Index class or subclasses

Comments:
Thanks @topper-123
CI: only run pylint in CI
State: closed


- [ ] closes #49526 (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.

I'm getting this mysterious message when trying to merge #49527

![image](https://user-images.githubusercontent.com/33491632/200078564-d1344175-b9a9-41bb-b027-73e87a29f762.png)

so I've tried opening a new PR, keeping @the-lazy-learner as commit author, to see if it works here

Labels:

Comments:
Thanks Joris! Merging then as the relevant checks pass, and this should make for a better contributing experience

And thanks @the-lazy-learner !
BUG: inconsistent DataFrame.agg behavoir when passing as kwargs numeric_only=True 
State: closed

- [x] closes #49352 
- [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: Apply
description: Apply, Aggregate, Transform, Map
name: Stale

Comments:
@rhshadrach can you please have a look at the PR since v1.5.2 will be released.
this doesn't have any tests
I wasn't sure if they are covered by default. Will add them. Thanks for your response.
To check in advance, is the appropriate location to add the test in the script below?:

`pandas/tests/apply/test_frame_apply.py`
> To check in advance, is the appropriate location to add the test in the script below?:
> 
> `pandas/tests/apply/test_frame_apply.py`

Yes - that's correct.
If it were better documented that passing the string alias of the DataFrame methods accepts the associated keyword arguments then I supposed it makes sense to support this, especially if the user passes multiple strings aliases into agg.
Thanks @mroeschke - @thlautenschlaeger can you add a description of whats happening here to the notes section of agg and apply.
> Thanks @mroeschke - @thlautenschlaeger can you add a description of whats happening here to the notes section of agg and apply.

@rhshadrach  Added the description to that section.  Also added an example to the doc for agg. Hope everything is alright now.
> @rhshadrach I'm assuming the other kwargs like `skipna` and `min_periods` have the same issue here in `agg`, but those don't need to be addressed in 1.5.x since those don't affect the `FutureWarning`?

Correct. While I do think things like skipna should work, they are not part of the regression due to the numeric_only changes.
Thanks for your reviews @mroeschke @rhshadrach 
I will go through your comments and integrate the change requests.
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.
@thlautenschlaeger - friendly ping. Are you interested in continuing? 
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.
STYLE pylint: 48855-duplicate-value
State: closed

Issue #48855. This PR enables pylint type "W" warning: `duplicate-value`
- [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

Comments:
apologies, this was an accident, I swapped back to the wrong tab, I meant to merge https://github.com/pandas-dev/pandas/pull/49527, looks like this one's failing one check
```
pylint..................................................................................................Failed
- hook id: pylint
- exit code: 8

************* Module pandas.core.dtypes.concat
pandas/core/dtypes/concat.py:284:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)

------------------------------------
Your code has been rated at 10.00/10
```
Hi @MarcoGorelli , my local pylint passes. I don’t know if this error is related to my changes. Could you please show me how the fixup for R1720 https://github.com/pandas-dev/pandas/pull/49537/commits/9739c1da8f4794f76f6f9280927962a31e583169 relates to this PR?


Hey @natmokval - you're right, it didn't come from your PR, it came from https://github.com/pandas-dev/pandas/pull/49520 , but that check was failing in this PR's CI, so I should've waited to fix that one first before merging this one

Thanks for all your help fixing these linting issues!
Thank you @MarcoGorelli for the explanation. It helps me to understand how changes are getting in.
DEPR: enforce Series.__setitem__ behavior with Float64Index and non-present int key
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: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Deprecate
description: Functionality to remove in pandas

Comments:
Merge conflict otherwise LGTM
Thanks @jbrockmendel
DOC: correctly format bullets in parameter descriptions for `fillna` methods
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

This is a small PR to correct formatting issues in docstrings for `method` options in following `fillna` methods:

- [pandas.Series.fillna](https://pandas.pydata.org/docs/reference/api/pandas.Series.fillna.html)
- [pandas.DataFrame.fillna](https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.fillna.html)
- [pandas.api.extensions.ExtensionArray.fillna](https://pandas.pydata.org/docs/reference/api/pandas.api.extensions.ExtensionArray.fillna.html)

Many thanks.

Labels:
name: Docs

Comments:
Great, thanks @noritada
Modify precommit config yaml and change name of typing step to Typing + pylint.
State: closed

Modify the pre-commit config.yml file and change name of step in code-checks.yml. Possible attempt to resolve #49526 
Please provide feedback an I'd try to incorporate those changes.

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

Comments:
merging as the affected checks all pass

EDIT: github won't let me, let's see if https://github.com/pandas-dev/pandas/pull/49538 solves this
BTW, there is an actual failure:

```
 pylint...................................................................Failed
- hook id: pylint
- exit code: 8

************* Module pandas.core.dtypes.concat
pandas/core/dtypes/concat.py:284:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)

```
> BTW, there is an actual failure:
> 
> ```
>  pylint...................................................................Failed
> - hook id: pylint
> - exit code: 8
> 
> ************* Module pandas.core.dtypes.concat
> pandas/core/dtypes/concat.py:284:8: R1720: Unnecessary "elif" after "raise", remove the leading "el" from "elif" (no-else-raise)
> ```

Yup, fixed in https://github.com/pandas-dev/pandas/pull/49537

A couple of us have had issues merging this one, not sure if the issue is on GitHub's side, but I've opened https://github.com/pandas-dev/pandas/pull/49538 to take this forwards (and have kept @the-lazy-learner as the commit author)
API: to_timedelta([bad_type]) TypeError instead of ValueError
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: Timedelta
description: Timedelta data type

Comments:
Thanks @jbrockmendel
API / CoW: constructing Series from Series creates lazy copy (with default copy=False)
State: closed

xref https://github.com/pandas-dev/pandas/issues/48998 (bullet point about constructors)

In the CoW proposal, the idea for constructors would be that those follow the lazy copy with CoW approach as well, just like other methods and indexing operations that create a new Series/DataFrame from another Series/DataFrame.  
That was not yet implemented in the initial implementation, and this PR is adding it for the `Series(series)` case.

Currently, the way I implemented this is by making a shallow copy of the manager. This however also affects the default (non-CoW) behaviour -> see https://github.com/pandas-dev/pandas/issues/49523. 
Depending on whether we are OK with changing ("fixing"?) that behaviour in 2.0 or not, I can leave this as is, or otherwise put the copy behind a `if get_cnofig("mode.copy_on_write")` check.

- [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: Copy / view semantics

Comments:
I updated this to put the actual code change behind a "if CoW" check (so this PR only changes something for the case of CoW enabled), and will do a separate PR to address https://github.com/pandas-dev/pandas/issues/49523 (and for both Series and DataFrame).
> will do a separate PR to address #49523 (and for both Series and DataFrame).

Opened https://github.com/pandas-dev/pandas/pull/50539 for this
STYLE: fix pylint: no-else-raise
State: closed

Issue https://github.com/pandas-dev/pandas/issues/48855. This PR enables pylint type "R" -no-else-raise warning:
- [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

Comments:
Just saw this failing the CI in a PR.  I find this more annoying than helpful.
> Just saw this failing the CI in a PR. I find this more annoying than helpful.

Fixed in https://github.com/pandas-dev/pandas/pull/49537 , apologies

I think it's pretty neat, but we can turn this check back off if you prefer
STYLE/PERF: replace string concatenations with f-strings in core
State: closed

Doing less concatenations and explicit cast calls in the core is likely to yield some performance improvements (see https://twitter.com/raymondh/status/1205969258800275456).

Split out of https://github.com/pandas-dev/pandas/pull/49229.
Refs https://github.com/pandas-dev/pandas/issues/29547 (a 2019 issue tracking replacing formatting with better alternatives)

- [ ] 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
- [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: Code Style
description: Code style, linting, code_checks

Comments:
Thanks @akx!
STYLE/PERF: use f-strings instead of ''.join on static elements
State: closed

Split out of #49229.
Refs https://github.com/pandas-dev/pandas/issues/29547 (a 2019 issue tracking replacing formatting with better alternatives)

- [ ] 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
- [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: Code Style
description: Code style, linting, code_checks

Comments:
Thanks @akx
STYLE: fix pylint consider-using-f-string issues
State: closed

Refs #48855

Also refs #49229 (my PR, a more thorough f-string cleanup)
Also refs #29547 (a 2019 issue tracking replacing formatting with better alternatives)

- [ ] [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: Code Style
description: Code style, linting, code_checks

Comments:
Thanks @akx
CLN: CategoricalIndex.reindex
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).

Simplify `Categorical.reindex`

Labels:
name: Categorical
description: Categorical Data Type
name: Clean

Comments:
thanks @lukemanley
DEPR: enforce indexing deprecations
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: Deprecate
description: Functionality to remove in pandas

Comments:
Thanks @jbrockmendel