BrandonFors/pandas-github-issues huggingface dataset:
DOC: Fix warnings on underline length (more)
State: closed

I missed the other instance of the problem in
https://github.com/pandas-dev/pandas/pull/46215.

- [x] 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 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 @NickCrews
TYP: pd.isna
State: closed

Inferred by mypy and pyright:
```py
import numpy as np
import pandas as pd

class A:
    ...

# bool
reveal_type(pd.isna(1))

# npt.NDArray[np.bool_]
reveal_type(pd.isna([]))
reveal_type(pd.isna(np.zeros(3)))
reveal_type(pd.isna(pd.DatetimeIndex([None])))

# pd.DataFrame
reveal_type(pd.isna(pd.DataFrame()))

# pd.Series
reveal_type(pd.isna(pd.Series()))

# Union of all possible cases
reveal_type(pd.isna(A())) # should be bool
```


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

Comments:
Would you mind not force pushing the branch  in the future?  It makes it hard to see what changes you made in just the last commit.
> Would you mind not force pushing the branch in the future? It makes it hard to see what changes you made in just the last commit.

Okay. was rebasing on main (git pull --rebase main) but kept the new commit separate.
> > Would you mind not force pushing the branch in the future? It makes it hard to see what changes you made in just the last commit.
> 
> Okay. was rebasing on main (git pull --rebase main) but kept the new commit separate.

I just do
```
git fetch upstream
git merge upstream/main
git add the_files_I_changed
git commit -m "why I changed those files"
git push origin mybranch
```
That seems to make it easier to track things for others.

@twoertwein I approved, but I think @simonjayhawkins or @jbrockmendel should take a look as well.
@twoertwein if you can merge master
green, except for mypy error also present on main
thanks @twoertwein
Build: configure timezone for dockered development environment
State: closed

- [x] closes #46217
- [x] [Tests 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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

This PR sets a timezone for the docker image.

After configuring a timezone, the file `./test_fast.sh` runs without crashing workers and failing tests.

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

Comments:
thanks @rendner
DOC: Fix warnings on underline length
State: closed

In the CI run
 https://github.com/pandas-dev/pandas/runs/5413504567?check_suite_focus=true
I noticed a few warnings when building the docs such as

```
/home/runner/miniconda3/envs/pandas-dev/lib/python3.8/site-packages/numpydoc/docscrape.py:434: UserWarning: potentially wrong underline length...
Methods
---------- in
Immutable sequence used for indexing and alignment. The basic object
storing axis labels for all pandas objects. Int64Index is a special case... in the docstring of Int64Index in /home/runner/work/pandas/pandas/pandas/core/indexes/numeric.py.
```

So these were trivial enough to clean up

- [x] (simple enough I didn't make one) 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 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:
The ASV check failed because of https://github.com/pandas-dev/pandas/pull/46193, this change is innocent.
thanks @NickCrews
REF: simplify factorize, fix factorize_array return type
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 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:
looks fine, assuming perf is neutral
> assuming perf is neutral

correct
TYP: loosen types of to_markdown, align to docs
State: closed

Docs already allowed pathlib.Path objects and such
code runs, but failed mypy typechecks. This fixes it.

- [x] closes #46211 
- [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 an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
As for code checks, I only ran the `typing` tests (from the provided container config in `.devcontainer.json`):

```bash
$ ./ci/code_checks.sh typing
mypy --version
mypy 0.931
Performing static analysis using mypy
Success: no issues found in 1363 source files
Performing static analysis using mypy DONE
```

Please let me know if an entry to the `vX.X.X.rst` file should be made (and which version). This change doesn't feel worth mentioning though.
thanks @alexpovel
REF: Move Categorical logic from Grouping (#46203)
State: closed

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


Labels:
name: Refactor
description: Internal refactoring of code
name: Groupby
name: Categorical
description: Categorical Data Type

Comments:
Hello @NickCrews! 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-03-03 20:48:50 UTC
The two failed CI runs are unrelated to this change:

- Building docs failed because of a network error trying to download an intersphinx inventory
- ASV failed because of https://github.com/pandas-dev/pandas/pull/46193

So this is passing all the relevant checks.
@jbrockmendel, if you get the chance for a review/initial glance, that would be awesome! Thanks.
I expect this was a useful exercise for getting to know this piece of the code, but it isn't clear that this refactor is an improvement.

> I expect this was a useful exercise for getting to know this piece of the code, but it isn't clear that this refactor is an improvement.

Exactly what I thought :) Sounds good, closing this.
PERF: avoid copies in frame[col].fillna(val, inplace=True) GH#46149
State: closed

- [x] closes #46149
- [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 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: Regression
description: Functionality that used to work in a prior pandas version

Comments:
Is this fix specific to `fillna()` usage with `inplace=True`? Would it also work with default `inplace=False`?
> Would it also work with default inplace=False?

No.
If that's out of scope for this PR I can open a new issue describing what I'm seeing after updating to `1.4.1`.

It's actually the same as https://github.com/pandas-dev/pandas/issues/46149, except my usage is:
```
df = df["field"].fillna("")
```

Of course I can just `loc` on `pd.isna()` and manually set to `""` but it'd be great to not need to update all of our usages of `fillna()`.
> If that's out of scope for this PR I can open a new issue describing what I'm seeing after updating to 1.4.1.

Please do.
@jbrockmendel ok to backport this if you can add a note in 1.4.2
@meeseeksdev backport 1.4.x
Something went wrong ... Please have a look at my logs.
Test : Pandas 1.0.5 → 1.1.0 behavior change on DataFrame.apply() where fn returns np.ndarray 
State: closed

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

Comments:
Thanks again @weikhor
Add benchmark for indexing with .loc for sorted/unsorted DatetimeIndex
State: closed

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


Labels:
name: Benchmark
description: Performance (ASV) benchmarks

Comments:
@mroeschke Hi The testing pipeline in green. Thank for review.
@mroeschke Pipeline check in green
Thanks for following up @weikhor
BUG: nullable groupby result dtypes
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).
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

to match the corresponding non-nullable behavior.

Labels:
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
greenish ex the asv broken by #46193
REF: simplify groupby.ops
State: closed

Inching towards refactoring out special-cased EA methods into EA/EADtype methods.

I expect this to need some troubleshooting on the 32bit linux build.

Labels:
name: Refactor
description: Internal refactoring of code
name: Groupby

Comments:
hmm lots of checks were skipped
hmmph 32bit build is still a PITA.  will troubleshoot a bit more and scale back the offending part of necessary.  related #46197 should be OK in the interim
looks like the 32bit is segfaulting and that is somehow screwing up the other builds?
punted on the 32bit thing; greenish
DOC: Clarify groupby.first does not use nulls 
State: closed

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


Labels:
name: Docs
name: Groupby

Comments:
great. can you also update `.last()`?
Thanks @NumberPiOso!
CLN: rolling step followups
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).

xref https://github.com/pandas-dev/pandas/pull/45765

Labels:
name: Window
description: rolling, ewma, expanding

Comments:
doc string check failing: https://github.com/pandas-dev/pandas/runs/5371271902?check_suite_focus=true
cc @rtpsw
> doc string check failing: https://github.com/pandas-dev/pandas/runs/5371271902?check_suite_focus=true

Note that, while trying to reproduce this, I got the following error after pulling main:
```
$ ./ci/code_checks.sh docstrings
Validate docstrings (GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PR06, PR08, PR09, PR10, EX04, RT01, RT04, RT05, SA02, SA03)
Traceback (most recent call last):
  File "./ci/../scripts/validate_docstrings.py", line 32, in <module>
    from numpydoc.docscrape import get_doc_object
ImportError: cannot import name 'get_doc_object' from 'numpydoc.docscrape' (/mnt/user1/tscontract/venv/lib/python3.8/site-packages/numpydoc/docscrape.py)
Validate docstrings (GL01, GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS03, SS04, SS05, PR03, PR04, PR05, PR06, PR08, PR09, PR10, EX04, RT01, RT04, RT05, SA02, SA03) DONE
```
I was able to move past this error by changing to `numpydoc>=1.2.0` in `requirements-dev.txt` and `pip install -r requirements-dev.txt`.
TST: add test for correct behaviour of multiIndex loc with splice
State: closed

- added test to check for the correct behaviour as in issue https://github.com/pandas-dev/pandas/issues/43599


Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
Hello @rogimus! 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-03-01 05:43:27 UTC
thanks @rogimus 
cheers! @jreback
BUG: groupby.min with UInt64 and empty group
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).
- [ ] 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: Groupby

Comments:
can you rebase
rebased+green.
DOC: Move general utility functions to better locations
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

There was `doc/source/reference/general_functions.rst` and `doc/source/reference/general_utility_functions.rst`

So split `doc/source/reference/general_utility_functions.rst` into appropriate sections




Labels:
name: Docs

Comments:
great
REF: implement _reconstruct_ea_result, _ea_to_cython_values
State: closed

The idea being to eventually refactor those into EA/EADtype methods, xref #43682


Labels:
name: Refactor
description: Internal refactoring of code

Comments:
https://dev.azure.com/pandas-dev/pandas/_build/results?buildId=74625&view=results looks like 32 bit failing
> looks like 32 bit failing

fixed
DOC: Remove computation.rst in favor of better docstrings
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

This page seemed unmaintained and stale relative to the 4 functions this page goes over.

Instead of trying to maintain documentation of these functions in 2 places, just improves the docstrings of the functions where information diverged.


Labels:
name: Docs

Comments:
looks fine
Enable server side cursors
State: closed

The old PR went stale and I ended up busy for a year so had to re-open in a new branch. Hoping to finally push this through

This pull request attempts to fix #35689.  I read an article by @itamarst and decided to look further into the codebase. After noticing that the fix semed to be simple I decided file a PR. The fix is naive and I'm not sure the true solution is as simple as I imagine it to be. There are probably many things I'm missing as I've not read the codebase in detail so do let me know what else needs to be addressed.

- [x] closes #35689
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [x] whatsnew entry(N.A.)

Labels:
name: IO SQL
description: to_sql, read_sql, read_sql_query
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.
Hello @J0! 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:

* In the file [`pandas/io/sql.py`](https://github.com/pandas-dev/pandas/blob/1d0a412049ba3b3f944b5f1f1cfc4610b7924186/pandas/io/sql.py):

> [Line 1394:1](https://github.com/pandas-dev/pandas/blob/1d0a412049ba3b3f944b5f1f1cfc4610b7924186/pandas/io/sql.py#L1394): [W293](https://duckduckgo.com/?q=pep8%20W293) blank line contains whitespace


Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge the main branch, address the review comments, and we can reopen.

@J0 Is this still being worked on?
Bug fix - GroupBy.describe produces inconsistent results for empty datasets
State: closed

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

Comments:
I close this since I stuck this for long time. I get simpler task. Thank for review.
Thank for review !!!
@jreback - good here?
ok. Currently, I do not have ideas. I will try it. 
@jreback

> umm this seems a lot special cases here - this already dispatches to describe which should be able to handle empties

This dispatches to DataFrame.describe via _python_apply_general which doesn't call the function when the frame is empty.
@jreback - gentle ping. See my comment immediately above.
will look

@weikhor can u merge master
thanks @weikhor
Update test_fillna.py
State: closed

- [x] closes #32414 
- [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 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 again @weikhor!
BUG: MultiIndex slicing with negative step
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 an entry in the latest `doc/source/whatsnew/v1.5.0.rst` file if fixing a bug or adding a new feature.

MultiIndex label-based (.loc) slicing with a _negative_ step size appears to contain a few bugs. 

#38071 may have partially addressed negative step size issues, but a few issues seem to remain. 

I believe this PR fixes the following:


Bug 1: slicing with non-null start/stop values returns an empty frame

```
    from pandas import DataFrame, IndexSlice, MultiIndex

    mi = MultiIndex.from_arrays([range(5)] * 2)
    df = DataFrame(1.0, index=mi, columns=['A'])

    target = IndexSlice[3:1:-1, :]
    df.loc[target, :]
```

Bug 2: negative step size other than -1 raises

```
    from pandas import DataFrame, IndexSlice, MultiIndex

    mi = MultiIndex.from_arrays([range(5)] * 2)
    df = DataFrame(1.0, index=mi, columns=['A'])

    target = IndexSlice[::-2, :]
    df.loc[target, :]
```

Bug 3: slicing a non-int labeled index level raises

```
    from pandas import DataFrame, IndexSlice, MultiIndex

    mi = MultiIndex.from_arrays([list('abcde')] * 2)
    df = DataFrame(1.0, index=mi, columns=['A'])

    target = IndexSlice['d':'b':-1, :]
    df.loc[target, :]
```

The tests have been expanded to cover these cases.

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
awesome. cc @phofl @jbrockmendel if any comments
gentle ping, but no worries if you want to give it more time for review. have a follow-on after this one.
@lukemanley yeah just having @jbrockmendel and @phofl give it a quick look over
thanks @lukemanley your other PR likely needs to be rebased