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

pandera not compatible with numpy 2.0 #1656

Closed
ostetzer opened this issue May 23, 2024 · 2 comments · Fixed by #1690
Closed

pandera not compatible with numpy 2.0 #1656

ostetzer opened this issue May 23, 2024 · 2 comments · Fixed by #1690
Labels
bug Something isn't working

Comments

@ostetzer
Copy link

Pandera seems to be incompatible with the neweset version of numpy 2.0:
When defining a simple class based on DataFrameModel, the following error occurs duing import:

...
from pandera.engines import numpy_engine, pandas_engine
...
AttributeError: np.string_ was removed in the NumPy 2.0 release. Use np.bytes_ instead.. Did you mean: 'strings'?

A clear and concise description of what the bug is.

  • [ x] I have checked that this issue has not already been reported.
  • [x ] I have confirmed this bug exists on the latest version of pandera.

Expected behavior

Pandera should work with newest numpy version 2.0

Desktop (please complete the following information):

  • OS: Windows
  • Python: 3.11
  • Numpy: 2.0
  • Pandas: 2.2.2
  • Pandera: 0.19.3
@ostetzer ostetzer added the bug Something isn't working label May 23, 2024
@cosmicBboy
Copy link
Collaborator

hi @ostetzer I see numpy 2 is finally in beta as a release candidate!

Can you share the schema that's raising this error?

@ostetzer
Copy link
Author

from pandera import Field, DataFrameModel
from pandera.typing import Series


class TimeSeriesData(DataFrameModel):
    time_data: Series[float]
    sensor_data: Series[float]

As mentioned above, the error occurs already during import (import numpy_engine, pandas_engine)

khaeru added a commit to khaeru/genno that referenced this issue Jun 19, 2024
- Convert AttributeError to ImportError.
- Use pytest.importorskip() per the ImportError.
- Create genno.testing.MARK and apply to affected tests.
khaeru added a commit to khaeru/genno that referenced this issue Jun 19, 2024
- Convert AttributeError to ImportError.
- Use pytest.importorskip() per the ImportError.
- Create genno.testing.MARK and apply to affected tests.
khaeru added a commit to khaeru/genno that referenced this issue Jun 19, 2024
- Convert AttributeError to ImportError.
- Use pytest.importorskip() per the ImportError.
- Create genno.testing.MARK and apply to affected tests.
khaeru added a commit to khaeru/genno that referenced this issue Jun 19, 2024
- Convert AttributeError to ImportError.
- Use pytest.importorskip() per the ImportError.
- Create genno.testing.MARK and apply to affected tests.
khaeru added a commit to khaeru/genno that referenced this issue Jun 19, 2024
- Convert AttributeError to ImportError.
- Use pytest.importorskip() per the ImportError.
- Create genno.testing.MARK and apply to affected tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants