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/7350#issuecomment-1338290177,https://api.github.com/repos/pydata/xarray/issues/7350,1338290177,IC_kwDOAMm_X85PxLAB,221526,2022-12-05T22:56:30Z,2022-12-05T22:56:30Z,CONTRIBUTOR,"So I'll say that taking my dataset and running `nc.squeeze()` was illustrative to the problem here. I see now that if a `Dataset` has scalar coordinates, they apply to every `DataArray`/`Variable` inside. So I see what prompts the current behavior. I think the mismatch in my mental model is due to me coming from netCDF CF land, where coordinates for a variable are based on: 1. Other variables that match relevant shared dimension names 2. Those explicitly listed in the `coordinates` attribute I see now that xarray does NOT implement that model. This was provoked by challenges creating a new `DataArray`, but I see those can be solved by passing in both `dims` and `coords` (when coords contains some scalar coords).","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1473329967 https://github.com/pydata/xarray/issues/7350#issuecomment-1337859447,https://api.github.com/repos/pydata/xarray/issues/7350,1337859447,IC_kwDOAMm_X85Pvh13,221526,2022-12-05T17:57:34Z,2022-12-05T17:57:34Z,CONTRIBUTOR,"IMO, it's not correctly implementing the rule as you phrased it. You said ""still present"", which isn't the case here since the coordinate wasn't present before. The behavior I'd advocate for is that a subsetting/selection operation should never add new coordinates that weren't previously present. That by itself would be less surprising. It would also help make things more sensible given that the coordinate is only added currently in the scalar case--if you ask for more data, the coordinate isn't added, which is also unexpected given the scalar case.","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1473329967