-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Mypy 0.910 gives an internal error on xarray.core.common.full_like #5960
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
Comments
Thanks for the issue @haroldmeerwaldt . Is this an issue with mypy though? FWIW I get a different error, which may be intentional:
|
Hi @max-sixty, yes you could definitely say this is an issue with mypy. I wanted to raise it here in case somebody using xarray encountered the same error. In the meantime I tried the commands I posted on an entirely clean environment, and then I do not get the error. Should have done that before, apologies. Something besides xarray and mypy seems to be causing this in my full environment. Could you leave this issue open for a bit while I investigate? Perhaps I can help somebody in the future encountering the same thing. Interesting that mypy fails on the command itself... What happens when you do: |
Seems like you weren't the only person who had an env issue! Mine now works too: ❯ mypy --show-traceback -c "import xarray" We can leave it open if you prefer! It does seem like a mypy issue though. So when you're comfortable we can close it, and if anyone else encounters it then reconsider. |
After a bit of investigating, I found that to reproduce this error, you need the
The issue was already posted at mypy: python/mypy#11007 and a fix was merged in the dev branch. If you want to fix this, you can:
|
Would it be possible to know which version of |
What happened:
mypy raised an internal error when checking importing xarray:
It appears to have to do with this piece of code on line 1664 in xarray.core.common.full_like:
What you expected to happen:
I expected mypy to pass without errors. In 0.18.2 it still worked:
Minimal Complete Verifiable Example:
pip install xarray pip install mypy mypy -c "import xarray" --show-traceback
Anything else we need to know?:
mypy version: 0.910
xarray version: 0.20.1
xarray 0.18.2 works fine, but 0.19.0 does not
Environment:
Output of xr.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.9.7 (tags/v3.9.7:1016ef3, Aug 30 2021, 20:19:38) [MSC v.1929 64 bit (AMD64)]
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 78 Stepping 3, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: ('Dutch_Netherlands', '1252')
libhdf5: 1.12.1
libnetcdf: None
xarray: 0.20.1
pandas: 1.3.4
numpy: 1.21.4
scipy: 1.7.2
netCDF4: None
pydap: None
h5netcdf: 0.11.0
h5py: 3.5.0
Nio: None
zarr: None
cftime: None
nc_time_axis: None
PseudoNetCDF: None
rasterio: None
cfgrib: None
iris: None
bottleneck: None
dask: None
distributed: None
matplotlib: 3.4.3
cartopy: None
seaborn: None
numbagg: None
fsspec: None
cupy: None
pint: None
sparse: None
setuptools: 58.5.3
pip: 21.3.1
conda: None
pytest: 6.2.5
IPython: 7.29.0
sphinx: None
The text was updated successfully, but these errors were encountered: