dask / dask/dask

dask.array `_array_expr_enabled` issues with LSP's

Open Beginner friendly
#11,930 0 comments 0 reactions 0 assignees View on GitHub
needs attention needs triage
Dominant language
Python
Stars
13.9k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

The import structure in the `dask.array.__init__.py` (because try: except blocks) causes issues with Pylance.

![Image](https://github.com/user-attachments/assets/918016c5-71d5-4d6f-830d-6c63fb4dfb71)

A simple solution can be acomplished in the following form, using `typing.TYPE_CHECKING`

![Image](https://github.com/user-attachments/assets/965a24b9-c299-4318-a5ea-82ca6475cd0b)

Which resolves the issue and at runtime `not TYPE_CHECKING` will always be true.

Which results in expected IDE behavior

![Image](https://github.com/user-attachments/assets/f2e49a00-37e6-4cb2-9aaa-e517c38f5469)

Contributor guide

Open the contributing guide

Research direction

Start by inspecting dask.array.__init__.py and reproduce the import behavior in Pylance. Compare the try/except import structure with the reported typing.TYPE_CHECKING approach, then verify that the expected symbols resolve correctly in the IDE without changing runtime behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
developer-experience
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
65/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.