Open DimitriPapadopoulos opened 2 weeks ago
This is a good test! Unfortunately our CI fails, and we couldn't work out a succinct way of changing our annotations so that we could resolve #9581.
If there were some way of adding this in part, that would be great. But likely we'll need to wait for more support so we can support this while having just DataArray
in the type definition without the full path (more discussion in the attached issue)
Maybe we make it optional, similar to pyright?
I was planning on exploring the suggestions in https://github.com/pydata/xarray/issues/9581.
But yes, I could make the test optional for now.
Is it helpful to have an optional CI which fails everytime at the first import though?
It looks like solutions that might work with beartype fail with MyPy. I haven't been able to find a solution within the little time I can dedicate to this issue.
In any case, it looks like TYPE_CHECKING
shouldn't be used, except to avoid circular imports.
This should prevent
TYPE_CHECKING
misuse.Fixes #9744.