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/2180#issuecomment-391914654,https://api.github.com/repos/pydata/xarray/issues/2180,391914654,MDEyOklzc3VlQ29tbWVudDM5MTkxNDY1NA==,6213168,2018-05-25T01:32:51Z,2018-05-25T01:33:25Z,MEMBER,"> If there are conflicts in dimension coordinate, should it be outer join?
Consider this example:
```
a = Dataset({
'x': [10, 20],
'd1': ('x', [100, 200]),
'd2': ('x', [300, 400])
})
b = Dataset({
'x': [15],
'd1': ('x', [500]),
})
a.update(b)
```
In the above, with anything but an outer join you're destroying d2 - which doesn't even exist in the rhs dataset! A sane, desirable outcome should be
```
Dataset({
'x': [10, 20, 15],
'd1': ('x', [nan, nan, 500]),
'd2': ('x', [300, 400, nan])
})
```
> If there are no conflicts in dimension coordinate, but there are conflicts in non dimension coordinate, whether left or right should be prioritized?
I think this should be a right join. I alway think of non-index coords as N-to-1 properties of the index. For example,
```
a = Dataset(
coords={
'country': ('country', ['UK', 'France', 'Greece']),
'currency': ('country', ['GBP', 'EUR', 'EUR']),
},
data_vars={
'GDP': ('country', [1000, 2000, 3000]),
'Debt': ('country', [100, 200, 300]),
})
b = Dataset( # Greece exits the Eurozone
coords={
'country': ('country', ['UK', 'France', 'Greece']),
'currency': ('country', ['GBP', 'EUR', 'GRD']),
},
data_vars={
'GDP': ('country', [1000, 2000, 150000]),
})
a.update(b)
```
In the above example, I just broke the Debt variable - as I forgot to perform a currency conversion for the greek debt, which has been silently changed from 300 EUR to 300 GRD.
However I can't see any elegant way to avoid this. I *definitely* would not like to duplicate the 'country' index.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,326205036
https://github.com/pydata/xarray/issues/2180#issuecomment-391904059,https://api.github.com/repos/pydata/xarray/issues/2180,391904059,MDEyOklzc3VlQ29tbWVudDM5MTkwNDA1OQ==,6213168,2018-05-25T00:15:55Z,2018-05-25T00:15:55Z,MEMBER,"Then I'm not sure I understand the change:
```
fridge = xarray.Dataset(
data_vars={
'fruits': ('fruit', [10]),
},
coords={
'fruit': ('fruit', ['apples']),
'quality': ('fruit', ['Red Velvet']),
})
shopping = xarray.Dataset(
data_vars={
'fruits': ('fruit', [20]),
},
coords={
'fruit': ('fruit', ['oranges']),
'quality': ('fruit', ['Tangerine']),
})
fridge.update(shopping) # throw away old contents and fill with new stuff
```
In both 0.10.3 and 0.10.4:
```
Dimensions: (fruit: 1)
Coordinates:
* fruit (fruit) object 'apples'
quality (fruit) object nan
Data variables:
fruits (fruit) float64 nan
```
The above doesn't make any sense to me. I wanted to replace the fruits variable with brand new content, and instead I lost both the old and the new?!?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,326205036
https://github.com/pydata/xarray/issues/2180#issuecomment-391900937,https://api.github.com/repos/pydata/xarray/issues/2180,391900937,MDEyOklzc3VlQ29tbWVudDM5MTkwMDkzNw==,6213168,2018-05-24T23:56:55Z,2018-05-24T23:56:55Z,MEMBER,"I'm of the strong opinion that _all_ joins should be outer joins unless the user explicitly says otherwise, as it's the approach least prone to do damage. I would humbly suggest considering the change for a future major release (0.11 / 0.12), with several minor releases before that printing futurewarnings.
This said, I think that changing from a right join (0.10.3) to a left join (0.10.4) will only cause breakages without providing any actual benefit in terms of user-friendliness, so we should retain the previous behaviour. A right join _vaguely_ makes more sense IMHO as it follows the general phylosophy of ``dict.update()`` where rhs wins in case of collision.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,326205036