BrandonFors/pandas-github-issues huggingface dataset:
TST: remove test_error
State: closed

It makes no sense to me that we'd test unwanted behavior by default and then override it for working arrays.

Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: ExtensionArray
description: Extending pandas with custom dtypes or arrays.

Comments:
the default behavior *is* to error, how else would you test this? an EA that does not inherit the arithmetic mixins *should* error on these
> the default behavior is to error, how else would you test this? an EA that does not inherit the arithmetic mixins should error on these

It is the default behavior, but it isnt the _desired_ behavior.  e.g. if im a downstream author and i inherit the test class and see that `test_errors` is failing, what does that indicate that I need to fix?  nothing, the test itself is the problem.

if you want to test that this raises on the base class then OK i guess, but it doesnt make sense to have a test that exists only to be overridden to as a no-op (no-test?)
> > the default behavior is to error, how else would you test this? an EA that does not inherit the arithmetic mixins should error on these
> 
> It is the default behavior, but it isnt the _desired_ behavior. e.g. if im a downstream author and i inherit the test class and see that `test_errors` is failing, what does that indicate that I need to fix? nothing, the test itself is the problem.

ok fair

> 
> if you want to test that this raises on the base class then OK i guess, but it doesnt make sense to have a test that exists only to be overridden to as a no-op (no-test?)

yes pls. the issue is that someone expecting that the artithmetic ops should work *just* by inheriting the base class. We also would want a test to break if support for arithmetic ops was pushed to the base class itself.

updated + green
thanks
Make get_loc with nan for FloatIndex consistent with other index types
State: closed

- [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

Have not added a whatsnew because I am not sure if 2 is expected here. You could also make a point for retruning nan. But to handle these cases consistently, we have to check for method here

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

Comments:
i think test failures should be fixed by merging master
@phofl can you merge master. ok with fixing this here or in followup to raise.
This is raising now if nan is not in Index
very nice!

this *may* close other issues (hard to search for but looking for indexing and nan)
BUG: #35830 Restore index & slice by date to DatetimeIndex
State: closed

#35830 DatetimeIndex has supported indexing by date for many many years. This was broken after 1.0.5. This attempts to restore support by converting a date to Timestamp in `get_loc` and `_validate_searchsorted_value`. This restores indexing slicing, and  `asof` but  `in` does not work. It seems the best solution would be to do the conversion in `DatetimeLikeArrayMixin._validate_scalar` but this breaks a test looking for an expected `FutureWarning` in `TestDataFrameIndexing::test_loc_setitem_datetime_coercion` warning a `Timestamp` can't be compared to a `date`

- [x] closes #35830
- [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
- [ ] whatsnew entry


Labels:
name: Stale

Comments:
I can add more tests for slicing and asof (they work) if this will be considered for merging
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.
Closing as it appears this PR has gotten stale. Let us know if you'd like to continue adding a deprecation warning for this behavior and we'd be happy to reopen.
BUG: Slicing DatetimeIndex with strings containing microseconds raising KeyError
State: closed

- [x] closes #33589
- [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

Is there a reason not supporting milliseconds resolution when supporting microseconds?

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

Comments:
hmm this is oddly failing the 3.9 build
can you merge master and let's see
Probably unrelated, this occurs every now and then. Merged master
thanks @phofl
DOC: remove references to dev.pandas.io
State: closed

- [ ] xref #39368 
- [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


Suggested fix 

- [x] Remove references to dev.pandas.io
- [ ] Ensure all content from http://dev.pandas.io/pandas-blog/ is on https://pandas.pydata.org/community/blog/
https://github.com/pandas-dev/pandas-blog/tree/master/content
https://github.com/pandas-dev/pandas/tree/master/web/pandas/community/blog
- [ ] Redirect dev.pandas.io

Labels:
name: Docs

Comments:
looks fine to me. cc @afeld @datapythonista 
Indeed, thanks @ayushmankumar7 !
@jorisvandenbossche  Thanks for accepting my PR! :100: 
I THANK YOUCẢM ƠN TẤT CẢ MỌI NGƯỜI ĐÃ GỌI VÀ LIÊN KẾT ĐẾN TÔI KÝ TÊN PHẠM VĂN TƯỜNG Vào 24 Th1, 2021 23:59, Ayushman Kumar <notifications@github.com> đã viết: closes #39368 tests added / passed Ensure all linting tests pass, see here for how to run them whatsnew entry
Suggested fix
 Remove references to dev.pandas.io Ensure all content from http://dev.pandas.io/pandas-blog/ is on https://pandas.pydata.org/community/blog/
https://github.com/pandas-dev/pandas-blog/tree/master/content
https://github.com/pandas-dev/pandas/tree/master/web/pandas/community/blog Redirect dev.pandas.io



You can view, comment on, or merge this pull request online at:
  https://github.com/pandas-dev/pandas/pull/39377

Commit Summary
removed references to dev.pandas.io

File Changes

    M
    .github/ISSUE_TEMPLATE/documentation_improvement.md
    (2)
  
    M
    README.md
    (2)
  
    M
    doc/source/whatsnew/v0.25.0.rst
    (2)
  
    M
    doc/source/whatsnew/v1.0.0.rst
    (4)
  
    M
    doc/source/whatsnew/v1.1.0.rst
    (2)
  
    M
    doc/source/whatsnew/v1.2.0.rst
    (2)
  
    M
    doc/source/whatsnew/v1.3.0.rst
    (2)
  

Patch Links:
https://github.com/pandas-dev/pandas/pull/39377.patchhttps://github.com/pandas-dev/pandas/pull/39377.diff

—You are receiving this because you are subscribed to this thread.Reply to this email directly, view it on GitHub, or unsubscribe.
REGR: write compressed pickle files with protocol=5
State: closed

- [x] closes #39002
- [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

I don't know why the change from #37056 fails in combination with `protocol=5` and compression. @ig248

An alternative fix would be to have `get_handle` insert a write buffer for all compressions (similar to #38728) to avoid if/else in format specific `to_*` 



Labels:
name: IO Pickle
description: read_pickle, to_pickle

Comments:
thanks @twoertwein 
@meeseeksdev backport 1.2.x
Fixed code breakage for return_type = tuples for axis = 0
State: closed

- [x] closes #35518
- [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


Labels:
name: Apply
description: Apply, Aggregate, Transform, Map
name: Stale

Comments:
Hello @rajat315315! 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-01-25 06:30:45 UTC
Are we sure this is the correct solution? Because in https://github.com/pandas-dev/pandas/issues/35518#issuecomment-748605452 it was mentioned that even for `list` then we should get a Series of lists, while with the current changes we have
```python
In [7]: pd.DataFrame([['orig1', 'orig2']]).apply(func=lambda col: ['new1', 'new2'])
Out[7]: 
      0     1
0  new1  new1
1  new2  new2
```
instead of
```python
0    [new1, new2]
1    [new1, new2]
dtype: object
```
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.
closing as stale (+ I don't think this is the solution)
DOC: Clarify behavior for Series with dict-like data and index
State: closed

- [x] closes #34534


I think the previous description was wrong. We only reindex if the index is not None, not the opposite.


Labels:
name: Docs
name: Series
description: Series data structure

Comments:
Added the example.

I think we should backport here? The sentence I fixed was added in 1.2 and is wrong
> Added the example.
> 
> I think we should backport here? The sentence I fixed was added in 1.2 and is wrong
yup can backport
thanks @phofl 
@meeseeksdev backport 1.2.x
ERR: Improve error message for Series.loc.getitem with too many dimensions
State: closed

- [x] closes #35349
- [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

tuple in tuple means we are indexing index and columns 

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
Good point. This is pretty straight forward
thanks @phofl 
@phofl I think this introduces a problem if the MultiIndex has a level that includes tuples e.g. (xref #27591)

```
lev1 = ["a", "b", "c"]
lev2 = [(0, 1), (1, 0)]
lev3 = [0, 1]
cols = pd.MultiIndex.from_product([lev1, lev2, lev3], names=["x", "y", "z"])
df = pd.DataFrame(index=range(5), columns=cols)
[test for DataFrame behavior (also broken xref #27591)

ser = df.iloc[0]
result2 = ser.loc[lev1[0], lev2[0], lev3[0]]  # <-- raises incorrectly
expected2 = ser.iloc[:1]  # actually i think this should drop all the levels and return a scalar, but thats a whole other thing
tm.assert_series_equal(result2, expected2)
```
CI: parallelize the documentation build
State: closed

Testing if this makes a difference in the build time, relative to `auto` (https://github.com/pandas-dev/pandas/pull/39364). 

- [ ] ~~closes #xxxx~~
- [ ] tests ~~added /~~ passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] ~~whatsnew entry~~


Labels:
name: Docs
name: CI
description: Continuous Integration

Comments:
Surprisingly, this was worse: the documentation builds were [around 14 minutes before](https://github.com/pandas-dev/pandas/runs/1752446903?check_suite_focus=true#step:6:1), and [this one took 17](https://github.com/pandas-dev/pandas/pull/39366/checks?check_run_id=1755669114#step:6:1). Oh well!
REF: Unify _set_noconvert_dtype_columns for parsers
State: closed

- [x] xref #39345
- [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

I unified the code which led to a bugfix. The test failed for the python parser case previously

Labels:
name: Refactor
description: Internal refactoring of code
name: IO CSV
description: read_csv, to_csv

Comments:
@jreback green
thanks !
DOC: parallelize the number of Sphinx jobs by default
State: closed

I'm assuming most people building docs would want that to happen as quickly as possible, so this has Sphinx use the maximum parallelism possible by default. [Corresponding Sphinx documentation.](https://www.sphinx-doc.org/en/master/man/sphinx-build.html#cmdoption-sphinx-build-j)

- [ ] ~~closes #xxxx~~
- [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
- [ ] ~~whatsnew entry~~


Labels:
name: Docs

Comments:
does this help?
Running on Codespaces, before and after:

```
$ git checkout upstream/master && python make.py clean && time python make.py --no-api
real    5m28.607s
user    5m58.308s
sys     1m50.928s
$ git checkout parallel-default && python make.py clean && time python make.py --no-api
real    3m25.720s
user    6m47.912s
sys     1m44.041s
```
can you merge master and ping on green
Anyone know what the `NameError: name 'plt' is not defined` is about?
> Anyone know what the `NameError: name 'plt' is not defined` is about?

did you rebase on master? this should have gone away
Seems like the problem is still there.

```
$ git rev-parse HEAD
fc9fdba6592bdb5d0d1147ce4d65639acd897565
$ python make.py --single whatsnew/v0.8.0.rst
Running Sphinx v3.3.1
loading translations [en]... done
loading pickled environment... done
[autosummary] generating autosummary for: index.rst
building [mo]: targets for 0 po files that are out of date
building [html]: targets for 1 source files that are out of date
updating environment: [config changed ('exclude_patterns')] 2 added, 0 changed, 1 removed
reading sources... [100%] whatsnew/v0.8.0                                                                    

>>>-------------------------------------------------------------------------
Exception in /root/workspace/pandas/doc/source/whatsnew/v0.8.0.rst at block ending on line 201
Specify :okexcept: as an option in the ipython:: block to suppress this message
---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
<ipython-input-2-65b822729fc4> in <module>
----> 1 plt.figure()

NameError: name 'plt' is not defined
<<<-------------------------------------------------------------------------
...
```
one more rebase if you pls
thanks @afeld
BUG: incorrect casting ints to Period in GroupBy.agg
State: closed

- [x] closes #38254
- [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

This is pretty much throwing in the towel on #38254.

Labels:
name: Period
description: Period data type

Comments:
thanks!
DOC: add option for skipping execution of code blocks
State: closed

Came up as an idea at the documentation meeting (https://github.com/pandas-dev/pandas/issues/39183). This should make documentation builds faster for people who aren't working on the code samples.

```
$ time python make.py --single getting_started/comparison/comparison_with_spreadsheets.rst
…
real    0m22.119s
user    0m13.745s
sys     0m1.700s
$ time python make.py --no-ipython --single getting_started/comparison/comparison_with_spreadsheets.rst
…
real    0m17.481s
user    0m11.750s
sys     0m1.521s
```

Very open to alternatives names to `--no-ipython`.

- [ ] ~~closes #xxxx~~
- [ ] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] ~~whatsnew entry~~


Labels:
name: Docs

Comments:
Speeds up full build by 36% in wall clock time.

```
$ python make.py clean && time python make.py html --num-jobs 4
…
real    7m51.219s
user    17m35.420s
sys     1m10.225s
$ python make.py clean && time python make.py html --no-ipython --num-jobs 4
…
real    5m1.531s
user    13m12.087s
sys     0m45.678s
```

Ran these in GitHub Codespaces.
status here?
On second thought, not sure it's worth the added complexity for the narrow use case. If someone disagrees, happy to reopen and fix. Thanks for the reviews!
BUG: Series.setitem raising ValueError when setting Series with scalar indexer
State: closed

- [x] closes #38303
- [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



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

Comments:
thanks @phofl
BUG: Series(list_of_tuples, dtype=PandasDtype(object))
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.html#code-standards) for how to run them
- [ ] whatsnew entry


Labels:
name: Bug
name: Constructors
description: Series/DataFrame/Index/pd.array Constructors

Comments:
i guess needs a whatsnew
TST: Multiindex slicing with NaNs, unexpected results for #25154
State: closed

- [x] closes #25154
- [x] tests added / passed
- [ ] Ensure all linting tests pass, see [here](https://pandas.pydata.org/pandas-docs/dev/development/contributing.html#code-standards) for how to run them
- [ ] whatsnew entry

Added test case for Multiindex slicing with NaNs. 
Executed linting test based on the instructions provided here and 23 errors were reported, however none regarding the python test file modified. 


Labels:
name: Testing
description: pandas testing functions or related to the test suite
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: MultiIndex

Comments:
I see that one python test, namely `pandas/tests/io/parser/common/test_chunksize.py::test_warn_if_chunks_have_mismatched_type`, fails, however I am not sure that my addition affects that test and I'm currently not able to replicate the failure localy. 
This test is unreliable, you can ignore this one 
thanks @theodorju
BUG: read_hdf bad filtering in case of categorical string columns
State: closed

- [x] closes #39189
- [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


This bug happens when filtering on categorical string columns and  choose a value which doesn't exist in the column.
Instead of returning an empty dataframe, we get some records. 
It happens because of the usage in numpy `searchsorted(v, side="left")` that find indices where elements should be inserted to maintain order (and not 0 in case that the value doesn't exist), like was assumed in the code.

I changed it to first the for the value, and use `searchsorted` only if value exists, I also added a test for this specific use case.
I think in the long run, maybe we should refactor this area in the code since one function covers multiple use cases which makes it more complex to test.

Labels:
name: IO HDF5
description: read_hdf, HDFStore
name: Categorical
description: Categorical Data Type

Comments:
yes, ofc.
I used unittest to write it and then understood that I'm not allowed to use it, so i need to convert my tests to monkeypatch pytest.
Hello @nofarm3! 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-01-26 19:36:42 UTC
REF: standardize get_indexer/get_indexer_non_unique
State: closed

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


Labels:
name: Refactor
description: Internal refactoring of code
name: Index
description: Related to the Index class or subclasses

Comments:
sure
TYP: Fix mypy ignores in parsers
State: closed

- [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

Tried fixing the Mypy Errors in parsers


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

Comments:
can you merge master
Done

@simonjayhawkins Is it ok to use the | syntax?
quick comment on the `|` syntax - this is in the pyupgrade roadmap (https://github.com/asottile/pyupgrade/issues/372)
Hello @phofl! 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-02-03 18:52:52 UTC
ping @simonjayhawkins 
thanks @phofl
BUG: DataFrame.__setitem__ not raising ValueError when rhs is df and has wrong number of columns
State: closed

- [x] closes #38604
- [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

Have to check how many columns key references before raising (duplicates or MultiIndex may reference more than one column)

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

Comments:
thanks @phofl
PERF: DatetimeIndex.get_indexer with mismatched tz
State: closed

Avoid casting to object dtype.

```
In [2]: dti = pd.date_range("2016-01-01", periods=10000, tz="US/Pacific")
In [3]: dti2 = dti.tz_convert("UTC")

In [4]: %timeit dti.get_indexer(dti2)
127 ms ± 4.69 ms per loop (mean ± std. dev. of 7 runs, 10 loops each)  # <-- master
352 µs ± 10.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)  # <-- PR

```

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Timezones
description: Timezone data dtype

Comments:
do we have any asv's on user facing, e.g. loc with mixed tz's?
> do we have any asv's on user facing, e.g. loc with mixed tz's?

i dont think so, this implements one that directly measures get_indexer, with a comment that it reached via `Series.__getitem__`
> do we have any asv's on user facing, e.g. loc with mixed tz's?

i dont think so, this implements one that directly measures get_indexer, with a comment that it reached via `Series.__getitem__`
thanks
BUG: SeriesGroupBy.value_counts() raising error on an empty Series
State: closed

- [x] closes #39172
- [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


Labels:
name: Bug
name: Reshaping
description: Concat, Merge/Join, Stack/Unstack, Explode

Comments:
@jreback Green and ready to go! 
looks good. can you merge master and ping on green (the reason is just merged a PR that changes the hashing of .value_counts()); it should be fine, just making sure.
@jreback I've merged the master, and it's green
thanks @AnnaDaglis keep em coming!