BrandonFors/pandas-github-issues huggingface dataset:
TYP: avoid inherit_names for DatetimeIndexOpsMixin
State: closed

Similar to #36742
 
xref #32100


Labels:
name: Datetime
description: Datetime data dtype
name: Typing
description: type annotations, mypy/pyright type checking
name: Stale

Comments:
Over multiple PRs, my goal is to remove `inherit_names` to make static type checkers aware of those methods.

The alternative is to keep `inherit_names` but add `method_name: type_annotation`. Writing those annotations is tricky for properties.

Adding little helper methods as done in #36742 and here has the advantage that we can easily express the type of properties, it is more difficult for the implementation and the annotations to get out of sync, and it might also be more readable. Mypy doesn't seem to support properties with decorators but it seems that it just ignores them, which should be fine in most/all cases (`@doc(...)` doesn't change the function signature)
Not a hill I plan to die on, but it isn't obvious to me that this is worthwhile.  we implemented inherit_names in the first place for boilerplate-reduction, which is still a good goal.
I think I addressed all comments but now we also have some small implementation changes. If you could please have another look @jbrockmendel  @mroeschke 
Generally looks okay to me. I don't have a strong opinion in which direction `inherit_names` should go (but generally I don't mind some boilerplating as it makes the code easier to grok IMO)
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 in the main branch, address any review comments and/or failing tests, and we can reopen.
> Thanks for the pull request, but it appears to have gone stale. If interested in continuing, please merge in the main branch, address any review comments and/or failing tests, and we can reopen.

Opened #49804
BUG: Fixed ignoring of nanoseconds when adding to series #47856
State: closed

- [ ] closes #47856 (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
While working on this, I also fixed a couple typos I noticed along the way.
Thanks @srotondo
BUG in read_pickle
State: closed

- [x] closes #47895
- [x]  passes all checks
- [ ] Fixed note in the latest `pandas/io/pickle.py`


Labels:
name: Docs
name: IO Pickle
description: read_pickle, to_pickle

Comments:
Hello @Kinza-Raza! 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-08-09 00:07:23 UTC
@MarcoGorelli I was trying to build the documentation as explained [here](https://pandas.pydata.org/docs/dev/development/contributing_documentation.html#how-to-build-the-pandas-documentation) but got some import errors (modules not found) even though I built the dev environment with docker.

It says in **make.py**

> To build the docs you must have all optional dependencies for pandas
installed. See the installation instructions for a list of these.

Could you redirect me to the installation instructions for future reference so I can view the changes I'm making? Many thanks!
> Could you redirect me to the installation instructions for future reference so I can view the changes I'm making? Many thanks!

The instructions should all be in https://pandas.pydata.org/docs/development/contributing.html - if anything's not clear / doesn't work, please do feel free to ask for help
SAS7BDAT parser: Fix page count
State: closed

While page size is 32 bits (https://github.com/Roche/pyreadstat/blob/e0627c7cf406e4296a9af16036a563719fcba237/src/sas/readstat_sas.c#L245) the page count is word size (https://github.com/Roche/pyreadstat/blob/e0627c7cf406e4296a9af16036a563719fcba237/src/sas/readstat_sas.c#L270-L284).

Unfortunately I don't have a test file that I can share.

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: IO SAS
description: SAS: read_sas
name: Stale

Comments:
Hmm maybe we can modify an existing test file and read the page count attribute from the parser. Not really an end to end test but the best idea I have 
@mroeschke do you prefer the kind of test I suggested to no test?
> @mroeschke do you prefer the kind of test I suggested to no test?

Yeah your suggested test would be good too add, thanks.
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.
@jonashaag could you merge in main one more time? This looked okay
See #48764 instead
> See #48764 instead

Cool that one looks better. Okay to close this then?
BUG Fix: Series.add(DataFrame) fails to align
State: closed

- [ ] closes #46179
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Needs Discussion
description: Requires discussion from core team before further action

Comments:
> Not sure, if this should work. The docstring says Series or scalar. Can you check how this is annotated?

agreed. The error message should perhaps be more informative.

Seems to be a long-standing behavior. would probably need to check for similar issues or other examples which would suggest that this should work. I'm not sure we guarantee associativity for addition of these mixed classes. Also the flex methods are also for methods that are not associative so may need also to parametrize the test over all the flex methods if doing this change. As I assume from the issue, that's the reasoning for expecting `Series.add(DataFrame)` to work?

The docstring defines our public api, so also this would perhaps be an enhancement and not a bug.

I think we should also maybe push the discussion on expected behavior back to the issue.

Agreed, let's continue the discussion to the issue before moving forward with the PR. Thanks @weikhor but feel free to contribute thoughts to the issue, closing for now. 
@simonjayhawkins @mroeschke @phofl  Thank :)
WARN,TST check stacklevel for all warnings 
State: closed

- [ ] closes #47919 (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
Should be possible eventually, but at the moment there are some places where it needs setting manually for it to work, e.g.

https://github.com/pandas-dev/pandas/blob/a6aaeb6baf679fe133e968e0f65199fc56d177b2/pandas/compat/pickle_compat.py#L108

It looks like there, the going back up the frames temporarily brings us into the standard library:
```python
(Pdb)  frame
<frame at 0x7f87356b1b20, file '/home/marco/pandas-marco/pandas/compat/pickle_compat.py', line 92, code __new__>
(Pdb) p frame.f_back
<frame at 0x7f873569f7c0, file '/home/marco/pandas-marco/pandas/compat/pickle_compat.py', line 231, code load_newobj>
(Pdb) p frame.f_back.f_back
<frame at 0x7f87356b3640, file '/home/marco/miniconda3/envs/pandas-dev/lib/python3.8/pickle.py', line 1212, code load>
(Pdb) p frame.f_back.f_back
<frame at 0x7f87356b3640, file '/home/marco/miniconda3/envs/pandas-dev/lib/python3.8/pickle.py', line 1212, code load>
(Pdb) p frame.f_back.f_back.f_back
<frame at 0x7f8735765800, file '/home/marco/pandas-marco/pandas/compat/pickle_compat.py', line 277, code load>
(Pdb) p frame.f_back.f_back.f_back.f_back
<frame at 0x7f87356a6c40, file '/home/marco/pandas-marco/pandas/io/pickle.py', line 213, code read_pickle>
(Pdb) p frame.f_back.f_back.f_back.f_back.f_back
<frame at 0x7f873569f400, file '/home/marco/pandas-marco/pandas/tests/io/test_pickle.py', line 240, code test_legacy_sparse_warning>
```
, I'll have a look at what can be done about that

Any places where the stacklevel isn't correct should now be caught by the tests anyway, as with this PR it'd be checked for all warnings and `check_stacklevel=True` is the default
Thanks for confirming. In any case, a check can be made in a follow up
Added improvements in to_datetime Error reporting message
State: closed

- closes https://github.com/pandas-dev/pandas/issues/16757 

- Changes description
: For issue https://github.com/pandas-dev/pandas/issues/16757 - added more details in error message about field and its position causing the issue in pandas/_libs/tslib.pyx in array_to_datetime


- Examples of changed error messages


    | Code       | Old Error ( on 1.4.3 ) | New Error |
    | ------------- | ------------- | ------------- |
    | pd.to_datetime(pd.Series(['2016-01-01', 'unparseable']), errors='raise')  | dateutil.parser._parser.ParserError: Unknown string format: unparseable  | dateutil.parser._parser.ParserError: Unknown string format: unparseable present at position 1 |
    | pd.to_datetime(pd.Series(['2016-01-01', 'unparseable']), format='%Y-%m-%d', errors='raise') | ValueError: time data unparseable doesn't match format specified  | ValueError: time data "unparseable" at position 1 doesn't match format specified |
    | pd.to_datetime(pd.Series(['2016-01-01', '12']), errors='raise') | ValueError: Given date string not likely a datetime.  | ValueError: Given date string 12 not likely a datetime present at position 1 |

Labels:
name: Datetime
description: Datetime data dtype
name: Error Reporting
description: Incorrect or improved errors from pandas

Comments:
> Any reasons why you don’t continue in #47597 ?

was suggested in the mentioned PR(#47597) to split the 3 issues for easier reviewing ( I probably should close the other PR )
Thanks @dannyi96
BUG: compare returning all nan columns when comparing ea and np dtypes
State: closed

- [x] closes #44014 (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
Thanks @phofl
ENH: DataFrame.drop copy kwd
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Enhancement
name: Stale

Comments:
I cant reproduce test failures locally, not sure whats going on here
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.
WEB: Fix link to PDEP 0001
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [ ] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [ ] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [ ] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.

Ref: https://github.com/pandas-dev/pandas/pull/47938#issuecomment-1207216768

Labels:
name: Bug
name: Web
description: pandas website
name: PDEP
description: pandas enhancement proposal

Comments:
Thanks @rhshadrach, good catch. I tested the link in the list but I forgot about this one.
DOC: Add tuple description to allowed inputs for iloc #47799
State: closed

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


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

Comments:
Thanks @pratikpatel2512
BUG: iloc.setitem raising NotImplementedError for all null slice with one column df
State: closed

- [x] closes #45469 (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.



Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Strings
description: String extension data type and string data
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
Thanks @phofl
BUG: to_string using wrong na_rep for ea dtype in multiindex
State: closed

- [ ] closes #xxxx (Replace xxxx with the Github issue number)
- [x] [Tests added and passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#writing-tests) if fixing a bug or adding a new feature
- [x] All [code checks passed](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#pre-commit).
- [x] Added [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [x] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


Labels:
name: Output-Formatting
description: __repr__ of pandas objects, to_string
name: MultiIndex
name: NA - MaskedArrays
description: Related to pd.NA and nullable extension arrays

Comments:
Thanks @twoertwein 
Thanks @phofl :)
Haha sorry thanks @phofl 😅 
No worries 😂
Backport PR #47581 on branch 1.4.x (BUG: DataFrame.loc not aligning rhs df for single block case)
State: closed

Backport PR #47581

cc @simonjayhawkins 

WIll put up a pr for the whatsnew later

Labels:
name: Indexing
description: Related to indexing on series/frames, not to indexes themselves
name: Regression
description: Functionality that used to work in a prior pandas version

Comments:
> we need to check whether #47361 was a regression first

sorry, meant #47216
OK if not a regression then not necessarily an issue as we can still do bug fixes in patch releases. don't merge yet, I'll look again tomorrow. If we go with the original commit in this PR we should probably do it as 2 separate backports. 
Yep, if we do both then separate.

I would just do the regression here. It's close to 1.5 anyway. The change compared to main is not that big
TST: GH39984 Addition to tests
State: closed

- [x] closes #39984 (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 [type annotations](https://pandas.pydata.org/pandas-docs/dev/development/contributing_codebase.html#type-hints) to new arguments/methods/functions.
- [ ] Added an entry in the latest `doc/source/whatsnew/vX.X.X.rst` file if fixing a bug or adding a new feature.


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

Comments:
Hello @BarkotBeyene! 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-08-11 21:39:20 UTC
Looks like a duplicate of https://github.com/pandas-dev/pandas/pull/48042 so closing
DEPS: Update cython
State: closed

- [x] xref #47978
- [x] xref #46848

Labels:
name: Build
description: Library building on various platforms
name: Dependencies
description: Required and optional dependencies

Comments:
Thanks @phofl 

we also want to add a release note (see 1.4.3, moreless copy and paste that one). Cython is a dev only dependency so I'll milestone as 1.4.4 for now.

we should probably also add the test from #47097
all the ci files and the setup.py also need updating
Thinking some more (after https://github.com/pandas-dev/pandas/pull/47097#issuecomment-1202934142) I think ok to also add a release note for the regression fix too.
Changed the other versions (forgot about them earlier) and added the test

lmk if there is a better place for this test
Thanks @phofl . Let's give others chance to comment before we merge as I only opened the issue this morning.
BTW, I've edited the description to not close the two issues, since we still need MacPython/pandas-wheels#188 as well.
您好，邮件已收到，谢谢！祝万事胜意！
Updated pyproject.toml too.
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 -x -m1 8cb64ab539779e4efc3c8f002c14c852d45da3bb
```

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

```
git commit -am 'Backport PR #47979: DEPS: Update cython'
```

4. Push to a named branch:

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

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

> "Backport PR #47979 on branch 1.4.x (DEPS: Update cython)"

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).
REF: Move Series logic from Index._get_values_for_loc
State: closed

Cleaner abstraction.

Labels:
name: Refactor
description: Internal refactoring of code

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 @jbrockmendel