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

Linear models raise expection at import with dask-2025.1.0 #1007

Open
markotoplak opened this issue Jan 30, 2025 · 2 comments
Open

Linear models raise expection at import with dask-2025.1.0 #1007

markotoplak opened this issue Jan 30, 2025 · 2 comments

Comments

@markotoplak
Copy link

Describe the issue:

Since dask==2025.1.0 I get an exception at importing dask_ml.linear_model with the latest dask_ml release (I did not run the development branch but at least the problematic import seems the same here). The same import works with 2024.12.1.

This is probably due to dask_expr inclusion in the main dask distrubution.

I fixed it locally by replacing import dask_expr with from dask.dataframe import dask_expr in linear_model/utils.py.

Minimal Complete Verifiable Example:

$ python -c "import dask_ml.linear_model"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/home/marko/venv312/lib/python3.12/site-packages/dask_ml/linear_model/__init__.py", line 5, in <module>
    from .glm import LinearRegression, LogisticRegression, PoissonRegression
  File "/home/marko/venv312/lib/python3.12/site-packages/dask_ml/linear_model/glm.py", line 19, in <module>
    from .utils import lr_prob_stack
  File "/home/marko/venv312/lib/python3.12/site-packages/dask_ml/linear_model/utils.py", line 10, in <module>
    import dask_expr
ModuleNotFoundError: No module named 'dask_expr'
@TomAugspurger
Copy link
Member

Thanks for the report. Mind making a PR with your fix? IMO, we can bump the minimum supported dask version to 2025.1.0, and avoid the need for compatibility code in dask-ml.

@jrbourbeau
Copy link
Member

I was about to open an issue for this but then saw one already existed -- thanks @markotoplak

IMO, we can bump the minimum supported dask version to 2025.1.0, and avoid the need for compatibility code in dask-ml.

+1 -- moving forward with the new default in dask makes sense to me too

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

No branches or pull requests

3 participants