hgrecco / pint-pandas

Pandas support for pint
Other
166 stars 41 forks source link

pint-pandas having problems with the new pint release #168

Closed andresliszt closed 1 year ago

andresliszt commented 1 year ago

pint released a new version 0.21 and pint-pandas is having problems when you try to import it AttributeError: module 'pint.compat' has no attribute 'upcast_types'

MichaelTiemannOSC commented 1 year ago

If you delete the last line of the file pint_array.py (which calls compat.upcast_types) it might just work. It does for me.

kplanken commented 1 year ago

I stumbled across this message after I figured out that commenting the last line in pint_array.py (line 995) indeed works.

sbowman-mitre commented 1 year ago

This solution is a good work-around when doing local development, but in a CI pipeline where these dependencies are being installed and then immediately used (no human involved), this is not a useful work-around. Any other ideas? Like, if I lock down to a specific version of pint, which one should I use?

EDIT: looks like using this in a requirements.txt suffices to get my automation running again: pint<0.21

mikapfl commented 1 year ago

Seems to be related to this commit in pint: https://github.com/hgrecco/pint/commit/77ff32a8e31164a9eedc4170924579b2911ed19e where the structure of pint's pandas integration was changed, and appending to upcast_types is not necessary any more to get pint-pandas working properly. So probably pint-pandas needs to support both the old way of integration and the new way?