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

Pin numpy to <2.0.0 #2195

Merged
merged 1 commit into from
Jul 3, 2024
Merged

Pin numpy to <2.0.0 #2195

merged 1 commit into from
Jul 3, 2024

Conversation

sunu
Copy link
Collaborator

@sunu sunu commented Jul 3, 2024

numpy 2.0.0 is not compatible with pandas 1.3.5 which results in celery worker breaking with the following error:

  File "/home/ifrc/go-api/country_plan/tasks.py", line 7, in <module>
    import pandas as pd
  File "/usr/local/lib/python3.9/site-packages/pandas/__init__.py", line 22, in <module>
    from pandas.compat import (
  File "/usr/local/lib/python3.9/site-packages/pandas/compat/__init__.py", line 15, in <module>
    from pandas.compat.numpy import (
  File "/usr/local/lib/python3.9/site-packages/pandas/compat/numpy/__init__.py", line 7, in <module>
    from pandas.util.version import Version
  File "/usr/local/lib/python3.9/site-packages/pandas/util/__init__.py", line 1, in <module>
    from pandas.util._decorators import (  # noqa
  File "/usr/local/lib/python3.9/site-packages/pandas/util/_decorators.py", line 14, in <module>
    from pandas._libs.properties import cache_readonly  # noqa
  File "/usr/local/lib/python3.9/site-packages/pandas/_libs/__init__.py", line 13, in <module>
    from pandas._libs.interval import Interval
  File "pandas/_libs/interval.pyx", line 1, in init pandas._libs.interval
ValueError: numpy.dtype size changed, may indicate binary incompatibility. Expected 96 from C header, got 88 from PyObject

numpy 2.0 support was added in pandas 2.2.2. Related issue: pandas-dev/pandas#59052

So we're pinning numpy to version < 2.0.0 until we can upgrade pandas to a newer version that supports numpy 2.0.

numpy 2.0.0 is not compatible with pandas 1.3.5.
numpy 2.0 support was added in pandas 2.2.2.
Related issue: pandas-dev/pandas#59052
@sunu sunu requested review from szabozoltan69 and batpad July 3, 2024 14:41
Copy link
Contributor

@szabozoltan69 szabozoltan69 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great and quick catch!

@szabozoltan69 szabozoltan69 merged commit 82bf380 into develop Jul 3, 2024
2 checks passed
@szabozoltan69 szabozoltan69 deleted the fix/pin-numpy branch July 3, 2024 14:50
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 this pull request may close these issues.

2 participants