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

E IndexError: list index out of range on Python 3.13 #1006

Closed
Zethson opened this issue Jan 21, 2025 · 3 comments
Closed

E IndexError: list index out of range on Python 3.13 #1006

Zethson opened this issue Jan 21, 2025 · 3 comments

Comments

@Zethson
Copy link

Zethson commented Jan 21, 2025

Describe the issue:

Minimal Complete Verifiable Example:

import dask_ml.preprocessing as daskml_pp

leads to

/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/ehrapy/preprocessing/_normalization.py:13: in <module>
    import dask_ml.preprocessing as daskml_pp
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/dask_ml/preprocessing/__init__.py:5: in <module>
    from .data import (
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/dask_ml/preprocessing/data.py:1048: in <module>
    class PolynomialFeatures(DaskMLBaseMixin, sklearn.preprocessing.PolynomialFeatures):
/opt/hostedtoolcache/Python/3.13.1/x64/lib/python3.13/site-packages/dask_ml/preprocessing/data.py:1060: in PolynomialFeatures
    __doc__ = "".join([splitted_orig_doc[0], __doc__, splitted_orig_doc[1]])
E   IndexError: list index out of range

Anything else we need to know?:

Works flawlessly in my CI with Python 3.12

Environment:

 + dask-glm==0.3.2
 + dask-ml==2024.4.4
  • Dask version: 2025.1.0
  • Python version: 3.13
  • Operating System: Linux
  • Install method (conda, pip, source): uv pip
@TomAugspurger
Copy link
Member

Thanks for the report. Can you confirm whether or not you have the same version of scikit-learn in those two environments?

@TomAugspurger
Copy link
Member

TomAugspurger commented Feb 2, 2025

Ah, this seems to be from the first bullet at https://docs.python.org/3/whatsnew/3.13.html#other-language-changes

The compiler now strips common leading whitespace from every line in a docstring.

We'll need to make the docstring handling more robust. str.partition might be better here than str.split.

@TomAugspurger
Copy link
Member

Should be fixed by #1008.

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

2 participants