BrandonFors/pandas-github-issues huggingface dataset:
TST: share a bunch of test_custom_business_day
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


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

Comments:
great!
BUG: NumericArray.__pos__ should make a copy
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


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

Comments:
suppose should add a whatsnew note at some point
Fix 'rtol' and 'atol' for numeric extension types
State: closed

- [ ] closes #xxxx
- [x] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

cc @stefansorgqc

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

Comments:
> does this have an associated issue / bug report?

No, shall I create one?
thanks @jonashaag
BUG: fix get_indexer_non_unique() with 'object' targets with NaNs (#4…
State: closed

…4482)

numpy.searchsorted() does not handle NaNs in 'object' arrays as
expected (numpy/numpy#15499).  Therefore we cannot search NaNs using binary
search.  So we use binary search only for targets without NaNs.

- [x] closes #44482 
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

This does also put the whatsnew of #44404 to the correct place.

Labels:
name: Bug
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Missing-data
description: np.nan, pd.NaT, pd.NA, dropna, isnull, interpolate

Comments:
Rebased & resolved conflict
thanks @johannes-mueller very nice, keep em coming!
avoid a warning by PyTypeChecker
State: closed

NDFrame.to_csv(str) got a warning by PyTypeChecker, "Expected type 'None', got 'str' instead"
use typing.Union to combine type "FilePathOrBuffer[AnyStr]" and "None", instead of " | " can avoid it.
![image](https://user-images.githubusercontent.com/24448028/141879473-56355ca2-60de-4405-94a3-fdc3013cf5a7.png)

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Labels:

Comments:
Hello @foreverseer! 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 2021-11-16 01:40:18 UTC
If `PyTypeChecker` cannot handle `|`, then it might be worth to open a bug at `PyTypeChecker`? Pandas is not yet a py.typed library, can you double-check that `PyTypeChecker` is getting the type annotations from pandas (or a third-party stub file)?

Do you mind testing whether `PyTypeChecker` still has the issue on master? You are welcome to also test `PyTypeChecker` with #43951.
> If `PyTypeChecker` cannot handle `|`, then it might be worth to open a bug at `PyTypeChecker`? Pandas is not yet a py.typed library, can you double-check that `PyTypeChecker` is getting the type annotations from pandas (or a third-party stub file)?
> 
> Do you mind testing whether `PyTypeChecker` still has the issue on master? You are welcome to also test `PyTypeChecker` with #43951.

pytypechecker is a function of pycharm
i mean not use Union to combine two type will cause a warning of pycharm 
![image](https://user-images.githubusercontent.com/24448028/141881148-ffd88aed-0dc9-4a58-9cfb-8ac01a742889.png)
↑this is pycharm's warning

`pandas/core/generic.py` uses the python 3.10+ syntax `|` (equivalent to `typing.Union`) and also has `from __future__ import annotations` which enables this syntax for older versions of python.

I recomend opening a bug with pycharm (after checking that pycharm is using the tpye annotations shipped with pandas itself - most likely it uses 3rd-party type stubs).
Agreed, pandas uses `|` instead of `Union` consistently in the code base so it appears that this is more of an upstream issue. Closing.
REF: rolling benchmarks to reduce redundant benchmarks
State: closed

xref https://github.com/pandas-dev/pandas/issues/44450
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them


Some of the current `param` definitions are causing the same benchmark to run more than once without changes. Reorganizing the benchmarks such that the `param` combinations avoid the redundancy. 


Labels:
name: Benchmark
description: Performance (ASV) benchmarks
name: Window
description: rolling, ewma, expanding

Comments:
thanks @mroeschke 

Thanks @mroeschke !
BUG: fix timedelta floordiv with scalar float (correction of #44466)
State: closed

Follow-up on https://github.com/pandas-dev/pandas/pull/44466#discussion_r749430496

I still need to add a test that would actually catch this

Labels:
name: Bug
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Timedelta
description: Timedelta data type

Comments:
Actually, I don't directly find a way to edit the test that it would have catched this. It seems that in practice timedelta division already acts similar as a floor division:

```
In [16]: np.array([1, 2, 3, 4, 5], dtype="m8[ns]") / 3
Out[16]: array([0, 0, 1, 1, 1], dtype='timedelta64[ns]')

In [17]: np.array([1, 2, 3, 4, 5], dtype="m8[ns]") // 3
Out[17]: array([0, 0, 1, 1, 1], dtype='timedelta64[ns]')

In [18]: np.array([1, 2, 3, 4, 5], dtype="m8[ns]").astype(float) / 3
Out[18]: array([0.33333333, 0.66666667, 1.        , 1.33333333, 1.66666667])
```

(so the integers for timedelta divison result already seem to be obtained with a floor round)
Actually with a round towards zero (so ``np.fix`` and not `np.floor`), but that is still done for both division and floor division.
To conclude: this can be merged as is?

(the one failure is a CSV compression failure, so I assume unrelated)
later today ill look at the scalar timedelta tests to see if past-me came up with anything.
BTW @jorisvandenbossche can you take a look at #43840
Looking at the scalar `Timedelta.__floordiv__` i dont see anywhere where this makes a difference.

LGTM
OK, merging this then
BUG: fix timedelta floordiv with scalar float
State: closed

Discovered while trying to fix test failures in https://github.com/pandas-dev/pandas/pull/40482. Currently normal division with a float scalar works, but floordiv doesn't (returns garbage):

```
In [42]: arr = pd.timedelta_range(0, periods=3)

In [43]: pd.Series(arr) / 2.0
Out[43]: 
0   0 days 00:00:00
1   0 days 12:00:00
2   1 days 00:00:00
dtype: timedelta64[ns]

In [44]: pd.Series(arr) // 2.0
Out[44]: 
0                 0 days 00:00:00
1   55681 days 08:53:22.404319232
2   55733 days 11:53:22.031689728
dtype: timedelta64[ns]

In [45]: pd.__version__
Out[45]: '1.3.3'
```

It's only the scalar case; dividing with eg float array already works:

```
In [46]: pd.Series(arr) // np.array([2.0]*3)
Out[46]: 
0   0 days 00:00:00
1   0 days 12:00:00
2   1 days 00:00:00
dtype: timedelta64[ns]
```

I suppose the current code uses the workaround of `asi8` and casting back to timedelta, because numpy didn't support floordiv in the past (didn't check which version started to implement this, will see what CI says)

- [ ] whatsnew entry


Labels:
name: Bug
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: Timedelta
description: Timedelta data type

Comments:
Hmm, so apparently it already passes on all numpy versions we test. OK, will clean-up then :)
CI: publish benchmarks log as artifact
State: closed

To check the benchmarks timings for https://github.com/pandas-dev/pandas/issues/44450

Labels:
name: CI
description: Continuous Integration
name: Benchmark
description: Performance (ASV) benchmarks
name: Stale

Comments:
where does this show up?
Well, it doesn't yet show up anywhere, because with the updated asv comment it complains about having no machine information (see failing ci of latest commit), and not directly sure how to fix that.
Potentially related upstream issue: https://github.com/airspeed-velocity/asv/issues/944
So the problem with using `asv run` instead of `asv dev` is that it now gives *"No information stored about machine 'fv-az186-290'. I know about nothing"*. Not directly sure how to work-around that (see also https://github.com/airspeed-velocity/asv/issues/944)
This pull request is stale because it has been open for thirty days with no activity. Please update or respond to this comment if you're still interested in working on this.
still active?
Looks like this currently isn't possible due to airspeed-velocity/asv#944. Once the upstream issue is address then this approach can be continued. Closing for now.
DataFrame.rename renames wrong elements
State: closed

- [x] closes #4980
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them


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

Comments:
thanks @DriesSchaumont
ENH: Add numba engine to rolling/expanding.std/var
State: closed

- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry


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

Comments:
Failure due to codecov not being able to tell the numba decorated function is inherently tested.
> is the arm failure real?

It's this flaky test

```
@pytest.mark.single
    def test_unique_bad_unicode(index_or_series):
        # regression test for #34550
        uval = "\ud83d"  # smiley emoj
```
thanks @mroeschke
BUG: Series/Index arithmetic result names with NAs
State: closed

- [x] closes #39757
- [x] closes #22041
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode
name: Numeric Operations
description: Arithmetic, Comparison, and Logical operations
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
looks fine can you add a whatsnew note
whatsnew added + greenish
Certainly no objection to the modification here, but I do wonder if we should be changing the API to narrow what is allowed as a Series name or DataFrame label. For example, from #39757,
```
series_a = Series([1,2,3], name=np.float64(1.0))
series_b = Series([1,2,3], name=(np.float64(1.0), np.float64(2.0)))
pd.concat([series_a, series_b], axis=1).columns.sort_values()
```

still fails. I am wondering if we should change the API to only allow basic primitive types (Boolean, int, str, float?, perhaps some others) and tuples of primitive types, rather than trying to chase these issues down.
the problem is that the name can be any pandas primitive or tuplr if those (as we allow this for index labels) which doesn't it much 
@jreback - I think you're saying that even if we were to add some restrictions, `np.float64` (and hence, tuples of such objects) should be allowed as a name. Is that right?
yes ultimately we allow these as names (well have to be hashable) or we could inhibit a number of downstream ops
TST: Troubleshoot windows timeouts
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Labels:

Comments:
any things found here?
nothing yet, plan is to keep re-pushing until a timeout happens in one of the windows builds and hope that this lets us identify which test its in
closing in favor of #44429
Revert "CI: xfail tests failing on numpy dev"
State: closed

Reverts pandas-dev/pandas#44362
closes #44343

Labels:
name: CI
description: Continuous Integration

Comments:
@meeseeksdev backport 1.3.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.3.x
git pull
```

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

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

```
git commit -am 'Backport PR #44452: Revert "CI: xfail tests failing on numpy dev"'
```

4. Push to a named branch :

```
git push YOURFORK 1.3.x:auto-backport-of-pr-44452-on-1.3.x
```

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

> "Backport PR #44452 on branch 1.3.x (Revert "CI: xfail tests failing on numpy dev")"

And apply the correct labels and milestones.

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

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

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
                
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.3.x
git pull
```

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

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

```
git commit -am 'Backport PR #44452: Revert "CI: xfail tests failing on numpy dev"'
```

4. Push to a named branch :

```
git push YOURFORK 1.3.x:auto-backport-of-pr-44452-on-1.3.x
```

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

> "Backport PR #44452 on branch 1.3.x (Revert "CI: xfail tests failing on numpy dev")"

And apply the correct labels and milestones.

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

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

If these instruction are inaccurate, feel free to [suggest an improvement](https://github.com/MeeseeksBox/MeeseeksDev).
TST: check_stacklevel=True in various tests
State: closed

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
great!
CI/TST Removed Timestamp.now() from tests. #44341
State: closed

Removed Timestamp.now() from tests. #44341

Replaced Timestamp.now () with pd.Timestamp (2021, 1, 1, 12)

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Timezones
description: Timezone data dtype

Comments:
Hello @Mikhaylov-yv! 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 2021-11-14 22:54:51 UTC
@Mikhaylov-yv does this cover *all* the uses in the tests (aside from specifically testing .now()?)

can you merge master.

also wouldn't object to a rule against using Timestamp.now() in testing (exempting the very few cases that we need it); this could be a followup or in this PR
cc @mroeschke 
Hello @jreback @mroeschke .

In these tests, `Timestamp (2021, 1, 1, 12)` is suitable as a replacement for `Timestamp.now ()`. Did I understand correctly?
In order not to duplicate the code, can I make a `Timestamp (2021, 1, 1, 12)` as a fixture?

Using this example, I wanted to make sure that I was doing it right.

If everything is OK. I will make corrections to all tests where there is a  `Timestamp.now ()`. Of course other than those checking the `Timestamp.now ()`.
>  In order not to duplicate the code, can I make a Timestamp (2021, 1, 1, 12) as a fixture?

Good idea. A new `fixed_now_ts` fixture would be helpful. Maybe also add minutes, seconds and microseconds to the fixture Timestamp just in case it was significant.

Also not mentioned in the original issue, but this also applies to `utcnow` where the original method isn't being tested.
thanks @Mikhaylov-yv happy to have you followup with a fixture for the 'now' tests.
@jreback Thanks for the support.  I keep working on the problem.
DOC: Remove use of as_type for PeriodIndex to DatetimeIndex conversion
State: closed

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them

Followup to #44398. Should get docs build to green. cc @jbrockmendel 

![image](https://user-images.githubusercontent.com/45562402/141684919-f8e79f49-a2c8-4001-bd2d-13849e5c0b41.png)



Labels:
name: Docs
name: Period
description: Period data type

Comments:
thanks @rhshadrach 
xref @jbrockmendel
Added "." on to check_dtype and obj parameter
State: closed

- [] closes #xxxx
- [] tests added / passed
- [] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [] whatsnew entry

From #28602
`pandas.testing.assert_categorical_equal: Parameter "check_dtype" description should finish with "."
pandas.testing.assert_categorical_equal: Parameter "obj" description should finish with "."`

Labels:
name: Docs

Comments:
can you merge master
Thanks @Varun270 - next time I'd advise to make a new branch for each issue you try to solve
> Thanks @Varun270 - next time I'd advise to make a new branch for each issue you try to solve

Noted, I Will keep it in mind!
ENH: Infer inner file name of zip archive (GH39465)
State: closed

relevant for `DataFrame.to_csv` and `Series.to_csv` with `compression='zip'`

- [x] closes #39465
  - also relevant for #26023
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry

This fix is similar-in-spirit to #40387, which has been abandoned.


## Before / After
```py
from pandas import pd

df = pd.DataFrame()
df.to_csv('../test.csv.zip')
```

### Before
```
> unzip -l test.csv.zip

Archive:  test.csv.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        3  2021-11-14 13:39   ../test.csv.zip
---------                     -------
        3                     1 file
```
Notice the `..` in the path - bad! And, of course, that the file _inside_ the zip file is also called `test.csv.zip`.

### After
```
> unzip -l test.csv.zip

Archive:  test.csv.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        3  2021-11-14 13:44   test.csv
---------                     -------
        3                     1 file
```

Labels:
name: IO Data
description: IO issues that don't fit into a more specific label

Comments:
cc @datapythonista because you reviewed that last PR
cc @twoertwein 
Thank you for the quick review @jreback 🙌 
is there anything still holding this off from merge?
thanks @MarcelGerber very nice!
COMPAT: Python 3.9.8
State: closed

Please see bpo 20028. https://github.com/python/cpython/pull/28705. 
This breaks our nightlies, but doesn't on regular CI. It should show up pretty soon in regular CI, once the conda-forge folks add it. 
This means unfortuanately that I have no way to test this.
Can someone with with the perms on the MacPython repo please trigger the nightlies manually to see if that fixes the builds after this? Thanks.

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Compat
description: pandas objects compatability with Numpy or Python functions

Comments:
web and docs fail is from master https://github.com/pandas-dev/pandas/pull/44398#issuecomment-968264701
> Can someone with with the perms on the MacPython repo please trigger the nightlies manually to see if that fixes the builds after this? Thanks.

https://github.com/MacPython/pandas-wheels/runs/4201999471
Thanks @lithomas1
BUG: AttributeError: 'BooleanArray' object has no attribute 'sum' while infer types #44079
State: closed

- [x] closes #44079
- [x] tests added / passed
- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [x] whatsnew entry


Labels:
name: IO CSV
description: read_csv, to_csv
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
Well the failing check is a different problem. And it's a future warning treated as an error. I should be able to fix that, but probably better on a different thread? 
thanks @zhangxiaoxing
BLD: Exclude CPT data files
State: closed

xref #44300. Since that added a .cpt data file, we should also exclude it from the manifest.
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


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

Comments:
thanks @lithomas1
ENH: Use stacklevel in warnings
State: closed

Part of #44347 

- [x] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them


Labels:
name: Enhancement
name: Warnings
description: Warnings that appear or should be added to pandas

Comments:
thanks @rhshadrach
TST: FIXMES in DataFrame.quantile tests
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry

cc @jorisvandenbossche these were introduced in #14536

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Algos
description: Non-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diff

Comments:
Thanks! That was a long time ago :)
REF: simplify putmask_smart
State: closed

- [ ] closes #xxxx
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit) for how to run them
- [ ] whatsnew entry


Labels:
name: Refactor
description: Internal refactoring of code
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Internals
description: Related to non-user accessible pandas implementation

Comments:
nice