Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pint_pandas won't import using pandas 2.1-dev version #194

Closed
topper-123 opened this issue Aug 1, 2023 · 3 comments · Fixed by #195
Closed

pint_pandas won't import using pandas 2.1-dev version #194

topper-123 opened this issue Aug 1, 2023 · 3 comments · Fixed by #195

Comments

@topper-123
Copy link
Contributor

I just tried pint_pandas using the dev version of pandas and got an error:

>>> import pint_pandas
AttributeError: module 'pandas.core.dtypes.dtypes' has no attribute 'PandasDtype'

The issue is that pandas has renamed PandasDtype to NumpyEADtype, see pandas-dev/pandas#54101.

@MichaelTiemannOSC
Copy link
Collaborator

Pandas 2.1rc0 has been released: https://github.com/pandas-dev/pandas/releases/tag/v2.1.0rc0

@andrewgsavage
Copy link
Collaborator

There is still some failures in the test suite when running against v2.1.dev, but fixing those will take some care to ensure the test suite will run in both v2.1 and in older pandas versions, so I'll take those in a separate PR.

Originally posted by @topper-123 in #195 (comment)

Looking through #196, there's quite a few tests where there will be different behaviour in v2.1. Would it be easier to release the current pint-pandas for pandas 2.0, then change the mimimum pandas requirement to 2.1 for the future?

ping @MichaelTiemannOSC @hgrecco

@MichaelTiemannOSC
Copy link
Collaborator

Good question. #196 is named pandas21_compat, but it derives from changes that work equally well with Pandas 2.0.3 and Pandas 2.1. Indeed, I've been continually developing and testing the uncertainties PR (#140) against both. That latter experience makes me more confident that there's less incompatibility between 2.0.x and 2.1 than meets the eye.

That said, my efforts with the pandas21_compat changes have been to absolutely minimize divergence from the Pandas 2.1 codebase (and to use that minimality to convince Pandas developers to accept a few PRs to improve Pandas itself). While pandas21_compat may yet need some other changes lifted from the uncertainties changes to preserve common operation with Pandas 2.0.3, it really depends on the code of this PR which I have been loathe to copy into my own PRs because I'd prefer to pull it as a merged change. Once we have that, we can see what it looks like to support both. I don't think it will be that hard. Though I also think that anybody using Pint-Pandas will have a strong incentive to move up to Pandas 2.1 because it really has a lot of EA improvements that will make Pint-Pandas sing.

@bors bors bot closed this as completed in 31a3055 Aug 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants