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

Support latest breaking dependency versions #1573

Closed
visr opened this issue Jun 21, 2024 · 6 comments · Fixed by #1618
Closed

Support latest breaking dependency versions #1573

visr opened this issue Jun 21, 2024 · 6 comments · Fixed by #1618
Labels
dependencies Pull requests that update a dependency file

Comments

@visr
Copy link
Member

visr commented Jun 21, 2024

In conda-forge/ribasim-feedstock#17 I had to add numpy <2.0. We should add that as well in the pyproject.toml, or look into supporting NumPy 2 directly.

We should use the ruff rule as mentioned in https://numpy.org/doc/stable/numpy_2_0_migration_guide.html.

Error in the feedstock was seemingly from pandera:

  File "/home/conda/feedstock_root/build_artifacts/ribasim_1718990264152/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.12/site-packages/pandera/strategies/pandas_strategies.py", line 42, in <module>
    from pandera.engines import numpy_engine, pandas_engine
  File "/home/conda/feedstock_root/build_artifacts/ribasim_1718990264152/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.12/site-packages/pandera/engines/pandas_engine.py", line 757, in <module>
    np.string_,
    ^^^^^^^^^^
  File "/home/conda/feedstock_root/build_artifacts/ribasim_1718990264152/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/python3.12/site-packages/numpy/__init__.py", line 397, in __getattr__
    raise AttributeError(
AttributeError: `np.string_` was removed in the NumPy 2.0 release. Use `np.bytes_` instead.. Did you mean: 'strings'?
@visr visr added the dependencies Pull requests that update a dependency file label Jun 21, 2024
@visr
Copy link
Member Author

visr commented Jul 1, 2024

Pandera now has a new v0.20 release that has NumPy 2 support: https://github.com/unionai-oss/pandera/releases/tag/v0.20.0
It looks like we are required to make some changes as well for v0.20:

pandera.SchemaModel is now deprecated, use pandera.DataFrameModel instead.

Though @rleander ran into an error related to this, so it looks like it is breaking for us.

@visr
Copy link
Member Author

visr commented Jul 3, 2024

From #1605:

python/ribasim/ribasim/geometry/edge.py:28: in <module>
    class EdgeSchema(pa.SchemaModel):
E   AttributeError: module 'pandera' has no attribute 'SchemaModel'

When we fix this, let's trigger a general pixi update as well.

@visr visr changed the title NumPy 2 support Support latest breaking dependency versions Jul 8, 2024
@visr visr pinned this issue Jul 8, 2024
@Fati-Mon
Copy link
Collaborator

Fati-Mon commented Jul 8, 2024

Users right now need to use these dependencies versions:

pandera = "<0.20"
pyarrow = "<15" 

@visr
Copy link
Member Author

visr commented Jul 8, 2024

The pyarrow compat was added in our pixi.toml in #1542 but is not in our conda compat settings. We should look into that as well. The error was coming from pandas, perhaps a newer pandas version already fixes it.

@evetion
Copy link
Member

evetion commented Jul 8, 2024

Do we also need to think about compatibility with hydrolib-core? Deltares/HYDROLIB-core#657

@visr
Copy link
Member Author

visr commented Jul 8, 2024

Not directly, but would be nice if those become compatible again soon.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants