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

Mypy failures with MultiIndex #10110

Open
jsignell opened this issue Mar 10, 2025 · 0 comments
Open

Mypy failures with MultiIndex #10110

jsignell opened this issue Mar 10, 2025 · 0 comments
Labels
needs triage Issue that has not been reviewed by xarray team member

Comments

@jsignell
Copy link
Contributor

What is your issue?

As seen in https://github.com/pydata/xarray/actions/runs/13771308824/job/38510332904?pr=10109 and https://github.com/pydata/xarray/actions/runs/13771399760/job/38510636156?pr=10062

 xarray/core/indexes.py: note: In member "stack" of class "PandasMultiIndex":
xarray/core/indexes.py:1051: error: Argument 2 to "MultiIndex" has incompatible type "list[ndarray[Any, dtype[Any]]]"; expected "Sequence[Sequence[int]]"  [arg-type]
Generated Cobertura report: /home/runner/work/xarray/xarray/mypy_report/cobertura.xml
xarray/core/indexes.py: note: In member "from_variables_maybe_expand" of class "PandasMultiIndex":
xarray/core/indexes.py:1123: error: Argument 2 to "MultiIndex" has incompatible type "list[Iterable[int]]"; expected "Sequence[Sequence[int]]"  [arg-type]
xarray/core/coordinates.py: note: In member "to_index" of class "AbstractCoordinates":
xarray/core/coordinates.py:186: error: Argument 2 to "MultiIndex" has incompatible type "list[ndarray[Any, dtype[Any]]]"; expected "Sequence[Sequence[int]]"  [arg-type]
xarray/core/groupby.py: note: In member "factorize" of class "ComposedGrouper":
xarray/core/groupby.py:530: error: Argument 1 to "from_product" of "MultiIndex" has incompatible type "Generator[ndarray[Any, Any], None, None]"; expected "Sequence[Any]"  [arg-type]
xarray/tests/test_dataset.py: note: In member "test_drop_indexes" of class "TestDataset":
xarray/tests/test_dataset.py:2926: error: List item 0 has incompatible type "list[int]"; expected "tuple[Hashable, ...]"  [list-item]
xarray/tests/test_dataset.py:2926: error: List item 1 has incompatible type "list[int]"; expected "tuple[Hashable, ...]"  [list-item]
xarray/tests/test_dataset.py: note: In member "test_rename_multiindex" of class "TestDataset":
xarray/tests/test_dataset.py:3222: error: List item 0 has incompatible type "list[int]"; expected "tuple[Hashable, ...]"  [list-item]
xarray/tests/test_dataset.py:3222: error: List item 1 has incompatible type "list[int]"; expected "tuple[Hashable, ...]"  [list-item]
Installing missing stub packages:
/home/runner/micromamba/envs/xarray-tests/bin/python -m pip install types-openpyxl


Generated Cobertura report: /home/runner/work/xarray/xarray/mypy_report/cobertura.xml
Found 8 errors in 4 files (checked 177 source files)
@jsignell jsignell added the needs triage Issue that has not been reviewed by xarray team member label Mar 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs triage Issue that has not been reviewed by xarray team member
Projects
None yet
Development

No branches or pull requests

1 participant