id,node_id,number,title,user,state,locked,assignee,milestone,comments,created_at,updated_at,closed_at,author_association,active_lock_reason,draft,pull_request,body,reactions,performed_via_github_app,state_reason,repo,type 564780280,MDExOlB1bGxSZXF1ZXN0Mzc0OTQ3OTE3,3769,concat now handles non-dim coordinates only present in one dataset,2448579,closed,0,,,1,2020-02-13T15:55:30Z,2020-02-23T20:48:19Z,2020-02-23T19:45:18Z,MEMBER,,0,pydata/xarray/pulls/3769," - [x] Tests added - [x] Passes `isort -rc . && black . && mypy . && flake8` - [x] Fully documented, including `whats-new.rst` for all changes and `api.rst` for new API ``` da1 = xr.DataArray([1, 2, 3], dims=""x"", coords={""x"": [1, 2, 3], ""y"": 1}) da2 = xr.DataArray([4, 5, 6], dims=""x"", coords={""x"": [4, 5, 6]}) xr.concat([da1, da2], dim=""x"") ``` This use case is quite common since you can get `da1` from something like `bigger_da1.sel(y=1)` On master this raises an uninformative `KeyError` because `'y'` is not present in all datasets. This is because `coords=""different""` by default which means that we are checking for equality. However `coords='different'`(and the equality check) is meaningless when the variable is only present in one of the objects to be concatenated. This PR skips equality checking when a variable is only present in one dataset and raises a nicer error message when it is present in more than one but not all datasets. ","{""url"": ""https://api.github.com/repos/pydata/xarray/issues/3769/reactions"", ""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,,13221727,pull