pydata / xarray

N-D labeled arrays and datasets in Python
https://xarray.dev
Apache License 2.0
3.62k stars 1.09k forks source link

Update mypy CI to python 3.12 #9319

Open Illviljan opened 3 months ago

Illviljan commented 3 months ago

xref #9315

Illviljan commented 3 months ago

Strange typing errors with 3.12, the ignores fixes the following errors:

xarray/tests/test_typed_ops.py: note: In function "test_dataset_typed_ops":
xarray/tests/test_typed_ops.py:139: error: Argument 1 to "_test" has incompatible type "Variable"; expected "Dataset"  [arg-type]
xarray/tests/test_typed_ops.py:140: error: Argument 1 to "_test" has incompatible type "DataArray"; expected "Dataset"  [arg-type]
xarray/tests/test_typed_ops.py:151: error: Argument 1 to "_test" has incompatible type "Variable"; expected "Dataset"  [arg-type]
xarray/tests/test_typed_ops.py:152: error: Argument 1 to "_test" has incompatible type "DataArray"; expected "Dataset"  [arg-type]
xarray/tests/test_typed_ops.py:163: error: Argument 1 to "_test" has incompatible type "Variable"; expected "Dataset"  [arg-type]
xarray/tests/test_typed_ops.py:164: error: Argument 1 to "_test" has incompatible type "DataArray"; expected "Dataset"  [arg-type]
Found 6 errors in 1 file (checked 172 source files)

I'm not sure how to deal with this, any ideas @headtr1ck ? Are these similar issues as the other ignores in these tests?

xref #8969.

headtr1ck commented 3 months ago

Well, the ignores just show that the operators are not properly typed. Maybe once 3.9 support is dropped I can try to improve this and get it working properly again...

dcherian commented 3 months ago

once 3.9 support is dropped

Let's do this now!

Armavica commented 2 months ago

Could it be linked to https://github.com/pydata/xarray/issues/9365?