html_url,issue_url,id,node_id,user,created_at,updated_at,author_association,body,reactions,performed_via_github_app,issue https://github.com/pydata/xarray/issues/5671#issuecomment-1000265317,https://api.github.com/repos/pydata/xarray/issues/5671,1000265317,IC_kwDOAMm_X847ntZl,5088535,2021-12-23T12:16:26Z,2021-12-23T12:18:22Z,NONE,"My issue might actually be fixed [in main](https://github.com/pydata/xarray/blob/5e8de55321171f95ed9684c33aa47112bb2519ac/xarray/core/dataarray.py#L370). EDIT: Change was made in #5728","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,959604710 https://github.com/pydata/xarray/issues/5671#issuecomment-1000257950,https://api.github.com/repos/pydata/xarray/issues/5671,1000257950,IC_kwDOAMm_X847nrme,5088535,2021-12-23T12:03:09Z,2021-12-23T12:03:09Z,NONE,"I can confirm this issue when specifying dimensions with coordinates, as per this example: ``` import xarray as xr z = -1 x = [1, 2, 3] y = [4, 5, 6] data = [0, 0, 0] coords = {""z"": z, ""x"": (""dim_0"", x), ""y"": (""dim_0"", y)} xr.DataArray(data, coords=coords) ``` MyPy output: ``` error: Argument ""coords"" to ""DataArray"" has incompatible type ""Dict[str, object]""; expected ""Union[Sequence[Tuple[Any, ...]], Mapping[Hashable, Any], None]"" ``` I can work around it by specifying the type of `coords` explicitly: ``` from typing import Any, Hashable, Mapping import xarray as xr z = -1 x = [1, 2, 3] y = [4, 5, 6] data = [0, 0, 0] coords: Mapping[Hashable, Any] = {""z"": z, ""x"": (""dim_0"", x), ""y"": (""dim_0"", y)} xr.DataArray(data, coords=coords) ``` ``` Success: no issues found in 1 source file ``` There is some discussion about `str` and `Hashable` in [this issue](https://github.com/python/mypy/issues/8293), but type invariance is still a little over my head, TBH. ","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,959604710 https://github.com/pydata/xarray/issues/5671#issuecomment-892238900,https://api.github.com/repos/pydata/xarray/issues/5671,892238900,IC_kwDOAMm_X841Lnw0,5635139,2021-08-03T23:43:38Z,2021-08-03T23:43:38Z,MEMBER,"Good spot, thanks @DeltaSigma130 . I think this should be a fairly easy fix if anyone is up for taking this. I'm somewhat surprised that it's not covered in our existing code such that mypy fails within xarray.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,959604710