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/1646#issuecomment-1094081191,https://api.github.com/repos/pydata/xarray/issues/1646,1094081191,IC_kwDOAMm_X85BNlqn,2448579,2022-04-09T16:39:04Z,2022-04-09T16:39:04Z,MEMBER,"We could also make it only succeed if `DataArray.name is None` and raise an error otherwise. 

Supporting the tuple form also seems like a good idea","{""total_count"": 1, ""+1"": 1, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588
https://github.com/pydata/xarray/issues/1646#issuecomment-1094074423,https://api.github.com/repos/pydata/xarray/issues/1646,1094074423,IC_kwDOAMm_X85BNkA3,5635139,2022-04-09T16:00:29Z,2022-04-09T16:00:29Z,MEMBER,"One option here would be to take the name of the dataarray iff the dim name is `dim_0`. While I'm not a great fan of breaking that abstraction and hardcoding exceptions, it does solve the case quite well:


```python


In [7]: xr.concat([da,da], xr.DataArray(['x', 'y'], name='stat'))
Out[7]:
<xarray.DataArray 'air' (dim_0: 2, time: 2920, lat: 25, lon: 53)>
array([[[[241.2    , 242.5    , 243.5    , ..., 232.79999, 235.5    ,
          238.59999],
         [243.79999, 244.5    , 244.7    , ..., 232.79999, 235.29999,
          295.19   ],
         [297.69   , 298.09   , 298.09   , ..., 296.49   , 296.19   ,
          295.69   ]]]], dtype=float32)
Coordinates:
  * lat      (lat) float32 75.0 72.5 70.0 67.5 65.0 ... 25.0 22.5 20.0 17.5 15.0
  * lon      (lon) float32 200.0 202.5 205.0 207.5 ... 322.5 325.0 327.5 330.0
  * time     (time) datetime64[ns] 2013-01-01 ... 2014-12-31T18:00:00
  * dim_0    (dim_0) <U1 'x' 'y'  # Very unlikely we even want `dim_0` here
```

It's very unlikely we even want `dim_0` there rather than `stat`","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588
https://github.com/pydata/xarray/issues/1646#issuecomment-356661287,https://api.github.com/repos/pydata/xarray/issues/1646,356661287,MDEyOklzc3VlQ29tbWVudDM1NjY2MTI4Nw==,1217238,2018-01-10T16:44:00Z,2018-01-10T16:44:00Z,MEMBER,"> What is the desired behaviour in this case viz. do we preserve dimension name new_dim or assign new name stat?

Oh, this is trickier than I thought!

The challenge is that once you make the DataArray, there is no good way to know if a default dimension name like `'dim_0'` was intentional or not.

The way to handle this currently is to pass a 1-dimensional `xarray.Variable` object for the `dim` argument. These don't have separate names, so there's no ambiguity:
```
In [5]: xarray.concat([xarray.DataArray(1), xarray.DataArray(2)], dim=xarray.Variable('x', [3, 4]))
Out[5]:
<xarray.DataArray (x: 2)>
array([1, 2])
Coordinates:
  * x        (x) int64 3 4
```

But this is a little verbose. Potentially we could call `xarray.as_variable()` on tuple inputs (like in the Dataset constructor) so `dim=('x', [3, 4])` works.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588
https://github.com/pydata/xarray/issues/1646#issuecomment-356188198,https://api.github.com/repos/pydata/xarray/issues/1646,356188198,MDEyOklzc3VlQ29tbWVudDM1NjE4ODE5OA==,2448579,2018-01-09T05:56:25Z,2018-01-09T05:56:25Z,MEMBER,"I have a simple fix in #1812 .

With that change, this works.
> print(xarray.concat(data, xarray.DataArray(['foo1', 'foo2', 'foo3', 'foo4', 'foo5'], name='stat'))

But if you provided a dimension name like
> print(xarray.concat(data, xarray.DataArray(['foo1', 'foo2', 'foo3', 'foo4', 'foo5'], dims=['new_dim'], name='stat'))

then `new_dim` is renamed to `stat`. What is the desired behaviour in this case viz. do we preserve dimension name `new_dim` or assign new name `stat`?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588
https://github.com/pydata/xarray/issues/1646#issuecomment-338576932,https://api.github.com/repos/pydata/xarray/issues/1646,338576932,MDEyOklzc3VlQ29tbWVudDMzODU3NjkzMg==,1217238,2017-10-23T07:55:59Z,2017-10-23T07:55:59Z,MEMBER,This is the location of the helper function that parsing the `dim` argument: https://github.com/pydata/xarray/blob/9763a66e0e4675e7adc3fff3830c62f0e31a2bb3/xarray/core/combine.py#L123,"{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588
https://github.com/pydata/xarray/issues/1646#issuecomment-338576290,https://api.github.com/repos/pydata/xarray/issues/1646,338576290,MDEyOklzc3VlQ29tbWVudDMzODU3NjI5MA==,1217238,2017-10-23T07:53:22Z,2017-10-23T07:53:22Z,MEMBER,"Agreed, this should definitely work! (I think the fact that it doesn't is probably related to the relatively recent change that made coordinate labels along dimensions optional.)","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,267521588