ynqa / pandavro

Apache Avro <-> pandas DataFrame
MIT License
134 stars 32 forks source link

Add support for numpy 2.0 #56

Open corentin-regent opened 4 months ago

corentin-regent commented 4 months ago

Numpy 2.0 just dropped and came with changes that broke pandavro. When importing pandavro I now get the following error:

AttributeError: `np.unicode_` was removed in the NumPy 2.0 release. Use `np.str_` instead.

There might be other breaking changes affecting this package, I did not investigate it. The full numpy 2.0 release notes can be found here.

fredcohen-aa commented 3 months ago

It just needs an update in this dictionary. I was attempting to do this change in a forked repo but I'm finding the unit tests aren't really functional on windows so can't be that confident this doesn't have unintended consequences.

NUMPY_TO_AVRO_TYPES = {
..
    np.dtype('O'): 'complex',  # FIXME: Don't automatically store objects as strings
    np.str_: 'string',