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/4529#issuecomment-715437186,https://api.github.com/repos/pydata/xarray/issues/4529,715437186,MDEyOklzc3VlQ29tbWVudDcxNTQzNzE4Ng==,14808389,2020-10-23T16:12:49Z,2020-10-23T16:12:49Z,MEMBER,"> I think it's OK to raise an error and ask the user to pass `DataArray.data` instead.
:+1:
`as_variable` is where the tuple is converted to a `Variable`, so that's where the check (or conversion) should go. I guess we should ask to change #4493?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,727623263
https://github.com/pydata/xarray/issues/4529#issuecomment-715369738,https://api.github.com/repos/pydata/xarray/issues/4529,715369738,MDEyOklzc3VlQ29tbWVudDcxNTM2OTczOA==,2448579,2020-10-23T14:15:52Z,2020-10-23T14:15:52Z,MEMBER,"> ds2 = xr.Dataset(dict(a=(('x', 'y'), ds.a))
Thinking about this some more, maybe we should raise an error here. This syntax is a tuple of `(dims, data, attrs, encoding)`; but `DataArrays` already have `dims`, `attrs` and `encoding`, so we'll need to deal with conflicts. I think it's OK to raise an error and ask the user to pass `DataArray.data` instead.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,727623263
https://github.com/pydata/xarray/issues/4529#issuecomment-714821638,https://api.github.com/repos/pydata/xarray/issues/4529,714821638,MDEyOklzc3VlQ29tbWVudDcxNDgyMTYzOA==,2448579,2020-10-22T23:45:56Z,2020-10-22T23:45:56Z,MEMBER,It seems like we should extract `DataArray.variable` before we get to anything in `variable.py` (if we can),"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,727623263
https://github.com/pydata/xarray/issues/4529#issuecomment-714801233,https://api.github.com/repos/pydata/xarray/issues/4529,714801233,MDEyOklzc3VlQ29tbWVudDcxNDgwMTIzMw==,14808389,2020-10-22T22:38:52Z,2020-10-22T23:16:35Z,MEMBER,"I think this is a duplicate of #4483: `xarray.core.variable.as_compatible_data` doesn't have a special code path for `DataArray` and thus falls back to: https://github.com/pydata/xarray/blob/333e8dba55f0165ccadf18f2aaaee9257a4d716b/xarray/core/variable.py#L219 where `DataArray.values` will cast using `numpy.asarray`.
You should be able to work around that by using either `xr.Dataset(dict(a=(('x', 'y'), ds.a.variable))` or `xr.Dataset(dict(a=(('x', 'y'), ds.a.data))`
#4493 tries to fix this, but importing `DataArray` in `as_compatible_data` to avoid circular imports feels a bit unclean.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,727623263
https://github.com/pydata/xarray/issues/4529#issuecomment-714692097,https://api.github.com/repos/pydata/xarray/issues/4529,714692097,MDEyOklzc3VlQ29tbWVudDcxNDY5MjA5Nw==,2448579,2020-10-22T18:51:36Z,2020-10-22T18:51:36Z,MEMBER,Looks like a bug to me.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,727623263