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/508#issuecomment-1362945983,https://api.github.com/repos/pydata/xarray/issues/508,1362945983,IC_kwDOAMm_X85RPOe_,5821660,2022-12-22T15:04:31Z,2022-12-22T15:04:31Z,MEMBER,There is another attempt to get this resolved in #7400. Any input appreciated over there.,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-1308665605,https://api.github.com/repos/pydata/xarray/issues/508,1308665605,IC_kwDOAMm_X85OAKcF,44142765,2022-11-09T12:16:13Z,2022-11-09T12:16:13Z,NONE,Any plans to support this?,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-1144845488,https://api.github.com/repos/pydata/xarray/issues/508,1144845488,IC_kwDOAMm_X85EPPSw,2448579,2022-06-02T13:10:04Z,2022-06-02T13:10:04Z,MEMBER,Yes that is correct,"{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-1144729188,https://api.github.com/repos/pydata/xarray/issues/508,1144729188,IC_kwDOAMm_X85EOy5k,16614296,2022-06-02T10:59:59Z,2022-06-02T10:59:59Z,NONE,"Hi guys! Just to clarify, this is not fixed by #3769 (which only concerns coordinates, not variables) nor by #3364 (which concerns `merge` not `concat`). It would be fixed by #3545, but this one is not merged yet. Right?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-553993804,https://api.github.com/repos/pydata/xarray/issues/508,553993804,MDEyOklzc3VlQ29tbWVudDU1Mzk5MzgwNA==,775186,2019-11-14T17:30:09Z,2019-11-14T17:30:09Z,CONTRIBUTOR,"Ok got it, I'll take a look and spin up a PR.
Thanks","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-553940815,https://api.github.com/repos/pydata/xarray/issues/508,553940815,MDEyOklzc3VlQ29tbWVudDU1Mzk0MDgxNQ==,2448579,2019-11-14T15:33:52Z,2019-11-14T15:33:52Z,MEMBER,"Thanks for tackling this very important issue @scottcha !
```
from .dataarray import DataArray
new_array = DataArray(coords=ds.coords, dims=ds.dims)
ds[k] = new_array
```
Instead of creating a DataArray we only need to create a `Variable` (https://xarray.pydata.org/en/stable/internals.html#variable-objects).
I would instead try `full_like(example_variable, fill_value=np.nan)` (import `full_like` from the appropriate file). The trick would be figuring out what `example_variable` is. Maybe like this? (there may be some clever way to avoid the two loops)
``` python
variables = []
for ds in datasets:
if k in ds.variables:
filled = full_like(ds.variables[k], fill_value=np.nan)
break
for ds in datasets:
if k not in ds.variables:
variables.append(filled)
else:
variables.append(ds.variables[k])
vars = ensure_common_dims(variables)
```
Please send in a PR with any progress you make. We are happy to help out. We have some documentation on contributing and testing here: https://xarray.pydata.org/en/stable/contributing.html","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-553709888,https://api.github.com/repos/pydata/xarray/issues/508,553709888,MDEyOklzc3VlQ29tbWVudDU1MzcwOTg4OA==,775186,2019-11-14T03:37:59Z,2019-11-14T04:09:02Z,CONTRIBUTOR,"I just ran in to this issue. While the previous fix seems to handle one case it doesn't handle all the cases. Before I clean this up and open a new PR does this look like its on the right track (it worked for my issue where I was concating multiple datasets which always had the same dims and coordinates but sometimes were missing variables)?
starts at line 353 on concat.py
```
for k in datasets[0].variables:
if k in concat_over:
try:
#new code
for ds in datasets:
if k not in ds.variables:
#make a new array with the same dimensions and coordinates
#by default this will be initialized to np.nan which is what we want
from .dataarray import DataArray
new_array = DataArray(coords=ds.coords, dims=ds.dims)
ds[k] = new_array
#end new code
vars = ensure_common_dims([ds.variables[k] for ds in datasets])
except KeyError:
#this can likely be removed then
raise ValueError(""%r is not present in all datasets."" % k)
combined = concat_vars(vars, dim, positions)
assert isinstance(combined, Variable)
result_vars[k] = combined
```","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746
https://github.com/pydata/xarray/issues/508#issuecomment-454533741,https://api.github.com/repos/pydata/xarray/issues/508,454533741,MDEyOklzc3VlQ29tbWVudDQ1NDUzMzc0MQ==,5635139,2019-01-15T20:10:58Z,2019-01-15T20:10:58Z,MEMBER,"Closing as stale, please reopen if still relevant","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,98587746