-
-
Notifications
You must be signed in to change notification settings - Fork 282
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
[v3] New Mypy errors now on v3 branch #2131
Comments
I think that numpy/numpy#27211 is the root cause of I think we'll need to work around it for now. |
I'm seeing a slightly different error for the dtype stuff in
I think this is coming down to a difference in static typing between a dtype declared as import numpy as np
from zarr.core.metadata import parse_fill_value_v3
reveal_type(parse_fill_value_v3(1, np.dtypes.UInt64DType()))
reveal_type(parse_fill_value_v3(1, np.dtype("uint64"))) mypy shows foo.py:5: note: Revealed type is "Union[numpy.signedinteger[numpy._typing._8Bit], numpy.signedinteger[numpy._typing._16Bit], numpy.signedinteger[numpy._typing._32Bit], numpy.signedinteger[numpy._typing._64Bit], numpy.unsignedinteger[numpy._typing._8Bit], numpy.unsignedinteger[numpy._typing._16Bit], numpy.unsignedinteger[numpy._typing._32Bit], numpy.unsignedinteger[numpy._typing._64Bit]]"
foo.py:6: error: No overload variant of "parse_fill_value_v3" matches argument types "int", "dtype[unsignedinteger[_64Bit]]" [call-overload]
foo.py:6: note: Possible overload variants:
foo.py:6: note: def parse_fill_value_v3(fill_value: Any, dtype: BoolDType) -> bool
foo.py:6: note: def parse_fill_value_v3(fill_value: Any, dtype: Int8DType | Int16DType | Int32DType | Int64DType | UInt8DType | UInt16DType | UInt32DType | UInt64DType) -> signedinteger[_8Bit] | signedinteger[_16Bit] | signedinteger[_32Bit] | signedinteger[_64Bit] | unsignedinteger[_8Bit] | unsignedinteger[_16Bit] | unsignedinteger[_32Bit] | unsignedinteger[_64Bit]
foo.py:6: note: def parse_fill_value_v3(fill_value: Any, dtype: Float16DType | Float32DType | Float64DType) -> floating[_16Bit] | floating[_32Bit] | floating[_64Bit]
foo.py:6: note: def parse_fill_value_v3(fill_value: Any, dtype: Complex64DType | Complex128DType) -> complexfloating[_32Bit, _32Bit] | complexfloating[_64Bit, _64Bit]
foo.py:6: note: Revealed type is "Any"
Found 1 error in 1 file (checked 1 source file) I'm not sure yet whether this is expected. For now, we can work around this with
I'm not 100% sure, but I think this is no worse than we were before. |
Thanks @dstansby and @TomAugspurger for sorting these out! |
We've started seeing the following errors in our pre-commit action. Would be good if we can give these some attention this week.
The text was updated successfully, but these errors were encountered: