iiasa / ixmp4

A data warehouse for high-powered scenario analysis in the domain of integrated assessment of climate change and energy systems modeling
https://docs.ece.iiasa.ac.at/ixmp4
MIT License
11 stars 6 forks source link

DeprecationWarnings with Python 3.12 #49

Open glatterf42 opened 8 months ago

glatterf42 commented 8 months ago

As mentioned in #41, we can get rid of the DeprecationWarnings for Python 3.12 by updating dateutil and pandera. Both seem to already include the necessary fixes on their main branches, but need to publish new releases (>2.8.2 and >0.18.0, respectively) unless we want to specify their github/main versions as our requirements. We might get notified about new releases by following up on these branches:

glatterf42 commented 8 months ago

With dask v2024.2.0, we are seeing another DeprecationWarning:

.venv/lib/python3.12/site-packages/pandera/typing/dask.py:9
  /home/fridolin/ixmp4/.venv/lib/python3.12/site-packages/pandera/typing/dask.py:9: DeprecationWarning: The current Dask DataFrame implementation is deprecated. 
  In a future release, Dask DataFrame will use new implementation that
  contains several improvements including a logical query planning.
  The user-facing DataFrame API will remain unchanged.

  The new implementation is already available and can be enabled by
  installing the dask-expr library:

      $ pip install dask-expr

  and turning the query planning option on:

      >>> import dask
      >>> dask.config.set({'dataframe.query-planning': True})
      >>> import dask.dataframe as dd

  API documentation for the new implementation is available at
  https://docs.dask.org/en/stable/dask-expr-api.html

  Any feedback can be reported on the Dask issue tracker
  https://github.com/dask/dask/issues 

    import dask.dataframe as dd

Curiously, we use dask.dataframe as dd here: https://github.com/iiasa/ixmp4/blob/6f7175151b44601341dbbe985f574c65740fd479/ixmp4/data/db/base.py#L302-L303 But the error message doesn't point us there. Instead, it almost looks like it refers to pandera's usage of dask.dataframe again (though if the user-facing API remains the same, why bother?). Either way, the topic has been raised with dask and they are reworking the DeprecationWarning, it seems.