BrandonFors/pandas-github-issues huggingface dataset:
TYP: annotation of __init__ return type (PEP 484) (pandas/utils)
State: closed

- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

According to [documentation](https://pandas.pydata.org/docs/dev/development/contributing_codebase.html#type-hints) pandas uses [PEP484](https://www.python.org/dev/peps/pep-0484/) for type hints.
PEP484 states that `__init__` function should have `-> None` return type annotation.
In this PR I added return type annotation to `__init__` functions in `pandas/utils` module.
Thanks!


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

Comments:
@nafarya Hi! Thanks for this! I'm wondering if there is a way to configure our code checks so that this is caught automatically? ie can black or flake8 somehow catch this? That seems like the golden standard, if possible, so that the **entire** codebase is consistent.
> @nafarya Hi! Thanks for this! I'm wondering if there is a way to configure our code checks so that this is caught automatically? ie can black or flake8 somehow catch this? That seems like the golden standard, if possible, so that the **entire** codebase is consistent.

Hi! Thats great idea and I think it should be possible! Maybe it could be done the same way as you check for [PEP 8](https://www.python.org/dev/peps/pep-0008): via https://github.com/pep8speaks
Floated the idea to black here: https://github.com/psf/black/issues/2913
Please wait for https://github.com/pandas-dev/pandas/pull/46283#discussion_r823143278
thanks @nafarya
CI/TST: numpy 1.22.3 release fixes
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).

Looks like this is xpassing now

```
___________________ test_alignment_deprecation_many_inputs ____________________
[gw0] win32 -- Python 3.9.10 C:\Miniconda\envs\pandas-dev\python.exe
[XPASS(strict)] ufunc 'my_ufunc' did not contain a loop with signature matching types
```


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

Comments:
LGTM pending green
@meeseeksdev backport 1.4.x
Something went wrong ... Please have a look at my logs.
TYP: expand acceptable types for pd.to_datetime()
State: closed

We document that `pd.to_datetime()` can accept a `DataFrame` or "dict-like" as an argument, but the overloads did not specify that.  This PR adds that.  

In addition, there was no overload for `Index` or `ExtensionArray` as an input type that converts to `DatetimeIndex`

Also, changed the overload for `pd.to_datetime()` on a scalar to only return `Timestamp` to make user code easier to write.  E.g.,
```python
import pandas as pd
ts: pd.Timestamp = pd.to_datetime("2022-03-05")
```
with the current version where `pd.to_datetime()` can return `Timestamp | NaTType`, users would have to do a `cast` 


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

Comments:
thanks @Dr-Irv
Correctly pass colLabels and rowLabels for plotting.table.
State: closed

- [x] closes #37811 (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: Visualization
description: plotting
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 the main branch, address the review comments, and we can reopen.
BLD: drop `options.package_data` from setup.cfg
State: closed

- [x] closes #46270
- [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] N/A Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

@fangchenli it looks like you have a lot of history here

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

Comments:
I think you need to trigger the sdist build. 

@lithomas1 
> I think you need to trigger the sdist build.

It looks like the sdist build ran? https://github.com/pandas-dev/pandas/runs/5470020092?check_suite_focus=true#step:5:856. There you can see that the `pandas/io/formats/templates/*.tpl` files are all included. Not sure about the `.dll` files, maybe that's what you mean, the windows sdist build needs to get run?

The test failures are unrelated, due to https://github.com/pandas-dev/pandas/pull/46274


If we wait for #46277 to land then we can manually inspect that this PR does not affect the sdists (at least the linux build on CI)
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.
OK, so I downloaded the python 3.9 `sdist` artifacts from the last successful run before this PR (https://github.com/pandas-dev/pandas/actions/runs/2118052199) and from this PR (https://github.com/pandas-dev/pandas/actions/runs/2138906174)

and ran `diff -rq pandas-1.5.0.dev0+660.gb3b5e2a46a pandas-1.5.0.dev0+663.g468ff52b7b` and got:
```
Files pandas-1.5.0.dev0+660.gb3b5e2a46a/MANIFEST.in and pandas-1.5.0.dev0+663.g468ff52b7b/MANIFEST.in differ
Files pandas-1.5.0.dev0+660.gb3b5e2a46a/PKG-INFO and pandas-1.5.0.dev0+663.g468ff52b7b/PKG-INFO differ
Files pandas-1.5.0.dev0+660.gb3b5e2a46a/pandas/_version.py and pandas-1.5.0.dev0+663.g468ff52b7b/pandas/_version.py differ
Files pandas-1.5.0.dev0+660.gb3b5e2a46a/pandas.egg-info/PKG-INFO and pandas-1.5.0.dev0+663.g468ff52b7b/pandas.egg-info/PKG-INFO differ
Files pandas-1.5.0.dev0+660.gb3b5e2a46a/setup.cfg and pandas-1.5.0.dev0+663.g468ff52b7b/setup.cfg differ
```
I checked each of these and they look as expected.

So I think that this doesn't introduce any other changes? @fangchenli any other things to check, or is this good to merge? Thanks!
thanks @NickCrews
REF: simplify reindexing in _align_series()
State: closed

Follow-up to #46058


Labels:
name: Refactor
description: Internal refactoring of code

Comments:
> Could you adress [#46058 (comment)](https://github.com/pandas-dev/pandas/pull/46058#discussion_r821210037) too?

That's what I intended to address, actually. No more `self.values` in the new version. 
Sorry, should have looked closer. Forget what I‘ve said
thanks @johannes-mueller
BUG: fix rolling with centering and axis=1 (#46135)
State: closed

- [x] closes #46135
- [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: Window
description: rolling, ewma, expanding

Comments:
@github-actions pre-commit
@github-actions pre-commit
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.
Hi,
maybe I'm missing something but it seemed to me that the failures in the checks are unrelated to the commited changes.
Can someone please take a look at it?
You will need to merge main and push to this branch again. Looks like previously the CI didn't run all the jobs
Thanks @jyuv
TYP: add type annotation to DataFrame.to_pickle
State: closed

- [x] closes #46081
- [ ] [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: Typing
description: type annotations, mypy/pyright type checking

Comments:
thanks @Moisan
TST: merge high_memory mark with single_cpu
State: closed

- [ ] [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).

3/4 tests that were using `@pytest.mark.high_memory` were already using `@pytest.mark.single_cpu`, so may as well combine them.


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

Comments:
hmm can you rebase
REF: use standard patterns in tslibs
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.

Some cleanups I noticed while implementing #46246.

Labels:
name: Refactor
description: Internal refactoring of code
name: Timezones
description: Timezone data dtype

Comments:
@jreback gentle ping, several follow-ups on deck
Thanks @jbrockmendel. Follow ups can be made as needed
REF: Refactor GroupBy a tiny bit
State: closed

- [NA, small] closes #xxxx (Replace xxxx with the Github issue number)
- [waiting for review] [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).
- [waiting for review] 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: Stale

Comments:
@jbrockmendel how about I drop the commit where I add `dropna`, address the other tweaks you suggest, and then we can merge this as a start? And then maybe do those offshoot changes separately?
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.
Looks like this is a bit more than I want to take on, but I pulled the less-controversial changes into https://github.com/pandas-dev/pandas/pull/46754, where hopefully they can still be merged.
TYP: annotation of __init__ return type (PEP 484) (pandas/core/arrays)
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

According to [documentation](https://pandas.pydata.org/docs/dev/development/contributing_codebase.html#type-hints) pandas uses [PEP484](https://www.python.org/dev/peps/pep-0484/) for type hints.
PEP484 states that `__init__` function should have `-> None` return type annotation.
In this PR I added return type annotation to `__init__` functions in `pandas/core/arrays` module


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

Comments:
Hello @EkaterinaKuzkina! 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-07 22:27:29 UTC
thanks @EkaterinaKuzkina
TYP: annotation of __init__ return type (PEP 484) (pandas/core/computation)
State: closed

- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).

According to [documentation](https://pandas.pydata.org/docs/dev/development/contributing_codebase.html#type-hints) pandas uses [PEP484](https://www.python.org/dev/peps/pep-0484/) for type hints.
PEP484 states that `__init__` function should have `-> None` return type annotation.
In this PR I added return type annotation to `__init__` functions in `pandas/core/computation` module

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

Comments:
thanks @EkaterinaKuzkina 
While I prefer having the explicit `None` annotation, I think @simonjayhawkins (and others) did not like the idea of adding `None`, I think because it is not needed, `__init__` can never return anything else.
DOC: update tutorial docs
State: closed

**N**itrogen Di-**O**xide


Labels:
name: Docs

Comments:
Do you have any others? If you, you can put them all in the same pr , no need to open multiple
> Do you have any others? If you, you can put them all in the same pr , no need to open multiple

@MarcoGorelli Thanks for the info. For the moment that's all the typos I discovered so far. But I'm planning to work through the tutorial the next days. I'll  just kep pushing my suggestions to this PR.



@eltenedor looking good. pls ping when ready.
@eltenedor pls merge master and make a non-draft and can merge
> @eltenedor pls merge master and make a non-draft and can merge

of course. 
thanks @eltenedor
CI/TYP: pyright reportSelfClsParameterName
State: closed

Fixes:

> pandas/core/arrays/_mixins.py:185:26 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)

I'm not familiar with the function, could also be a `classmethod` @jbrockmendel 



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

Comments:
should be a classmethod
Ready and green.

Removes also an unused mypy ignore which caused an error on main.
DOC+BUG: `Styler.to_excel` pseudo css `number-format`
State: closed

- [x] closes #46152 


Labels:
name: Styler
description: conditional formatting using DataFrame.style

Comments:
thanks @attack68 
@meeseeksdev backport 1.4.x
Owee, I'm MrMeeseeks, Look at me.

There seem to be a conflict, please backport manually. Here are approximate instructions:

1. Checkout backport branch and update it.

```
git checkout 1.4.x
git pull
```

2. Cherry pick the first parent branch of the this PR on top of the older branch:
```
git cherry-pick -m1 e67fdf63dc0280f0bff136ea9c8c9e174d13ab50
```

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

```
git commit -am 'Backport PR #46239: DOC+BUG: `Styler.to_excel` pseudo css `number-format`'
```

4. Push to a named branch:

```
git push YOURFORK 1.4.x:auto-backport-of-pr-46239-on-1.4.x
```

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

> "Backport PR #46239 on branch 1.4.x (DOC+BUG: `Styler.to_excel` pseudo css `number-format`)"

And apply the correct labels and milestones.

Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon!

Remember to remove the `Still Needs Manual Backport` label once the PR gets merged.

If these instructions are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
Bug fix - cannot construct Index of empty tuples
State: closed

- [x] closes #45608 
- [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: MultiIndex
name: Index
description: Related to the Index class or subclasses

Comments:
this is failing a lot of tests.
Yes. I need to fix codes to include all test cases.
> pandas/core/indexes/multi.py:493: error: List item 0 has incompatible type "List[Any]"; expected "ndarray[Any, Any]"  [list-item]
> > pandas/core/indexes/multi.py:493: error: List item 0 has incompatible type "List[Any]"; expected "ndarray[Any, Any]"  [list-item]

Have resolved
Hello @weikhor! 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-28 12:47:36 UTC
Thank for review. 
thanks @weikhor
PERF: reindex with MultiIndex
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.

Avoid unnecessary (and potentially expensive) call to MultiIndex._values. This only matters when MultiIndex._values has not been cached. Existing asv has been updated to test cached and non-cached cases.

```
import numpy as np
import pandas as pd

mi = pd.MultiIndex.from_arrays(
  [np.arange(10**6)] * 2
)
mi2 = pd.MultiIndex.from_arrays(
  [np.arange(10**7)] * 2
)

df = pd.DataFrame({"A": 1.0}, index=mi)

%timeit x = df.reindex(mi2.copy())
```

```
1.84 s ± 106 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)   <- main
685 ms ± 22.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)  <- PR
```

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Performance
description: Memory or execution speed performance
name: MultiIndex

Comments:
very nice @lukemanley 
I think this PR made pyright unhappy, but I honestly don't see how this PR affected _mixins.py:

> pandas/core/arrays/_mixins.py:185:26 - warning: Instance methods should take a "self" parameter (reportSelfClsParameterName)

If the solution is to ignore this warning, you can add
`# pyright: reportSelfClsParameterName = false`
at the top of the file.

edit:
or rename cls to self:
https://github.com/pandas-dev/pandas/blob/3e718e3f20df55d7f915985d427e28e4c00d79a2/pandas/core/arrays/_mixins.py#L185
i think was a prior PR
> i think was a prior PR

Yes, you are right: #46214 If no one beats me, I will create a PR to rename cls to self
ASV: add benchmarks for DataFrame.xs with a MultiIndex
State: closed

- [x] closes #35188 
- [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).

The slowdown in the linked issue has already been resolved. This PR just adds some ASVs.

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

Comments:
thanks @lukemanley
DOC: Added plt.show() at the end of each necessary block
State: closed

Added plt.show() at the end of each necessary block.
Moved and reworded title section.

- [ ] closes #45772 
- [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: Visualization
description: plotting

Comments:
![Screenshot 2022-04-10 at 12-17-43 How do I create plots in pandas — pandas 1 5 0 dev0 661 g0442a4cb65 dirty documentation](https://user-images.githubusercontent.com/20362314/162615557-7cdceef0-d517-4fa3-88f2-77a0584b7905.png)

thanks @ehallam
DOC: migrate from sphinx-panels to sphinx-design
State: closed

- closes #52939

Eventually it is the goal that the sphinx-design package replaces the sphinx-panels package (see https://github.com/executablebooks/sphinx-panels/issues/67 and https://sphinx-design.readthedocs.io/en/furo-theme/get_started.html#migrating-from-sphinx-panels, sphinx-design has the same (and more) features, but with a refactored and more flexible code base). 

So this PR moves our usage of sphinx-panels to sphinx-design (at least already for the front page, still need to do the same for the getting started pages)

It gives almost identical result as we have now (screenshot is with this PR, compare with eg https://pandas.pydata.org/pandas-docs/version/1.3/):

![image](https://user-images.githubusercontent.com/1020496/156773002-735b352e-26ad-408e-b792-9f3325f2e277.png)


Labels:
name: Docs

Comments:
looks like failing doc build
```
Extension error:
Could not import extension sphinx_design (exception: No module named 'sphinx_design')
```
Is a dependency missing?
Yes, I didn't yet update the CI / requirements, because there is also more sphinx-panels usage to convert. Should have made it a draft PR!
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.
is this active?
> is this active?

thanks @jorisvandenbossche for the additional commits. Is this ready for review?
Closing to clear the queue, but feel free to reopen if you have time and interest to work on it again. 
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/46227/
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/46227/
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/46227/
@phofl @datapythonista @jorisvandenbossche I think this PR is ready now if you could review when you have time
/preview
Website preview of this PR available at: https://pandas.pydata.org/preview/46227/
Build: unpin version of base image of dockered development environment
State: closed

This PR removes the pinned version for the base image.

The latest version of the base image, `quay.io/condaforge/miniforge3:4.11.0-4` (released Feb 26, 2022),  works again.

The pinned version was needed temporarily because of a misbehaving version of the base image: https://github.com/pandas-dev/pandas/pull/45889#issuecomment-1040827073

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

Comments:
thanks @rendner