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/7463#issuecomment-1427538729,https://api.github.com/repos/pydata/xarray/issues/7463,1427538729,IC_kwDOAMm_X85VFoMp,4160723,2023-02-13T08:31:49Z,2023-02-13T09:26:10Z,MEMBER,"There are two issues:
- whether we should continue allowing IndexVariable data be updated in place via `.data` property. IMO we should really deprecate it, especially that now it is possible to have custom, possibly expensive index structures built from one or more coordinates.
- whether `deep=True` should deep copy the Xarray index objects. I don't have strong opinion on this. There is a similar discussion on the pandas side: https://github.com/pandas-dev/pandas/issues/19862. I wonder if we reverted the change here because some high-level operations in Xarray were *by default* deep copying the indexes? I don't think we would want such behavior unless the user explicitly sets `deep=True` somewhere?","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1550792876
https://github.com/pydata/xarray/issues/7463#issuecomment-1426311006,https://api.github.com/repos/pydata/xarray/issues/7463,1426311006,IC_kwDOAMm_X85VA8de,4160723,2023-02-10T20:31:10Z,2023-02-10T20:38:48Z,MEMBER,"Yes I think we should, but I might have missed the rationale behind allowing it if this is intentional.
EDIT: perhaps better to issue a warning first to avoid some breaking change. We could also try to fix it (make a deep copy) at the same time as deprecating it, but that might be tricky without again introducing performance regressions.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1550792876
https://github.com/pydata/xarray/issues/7463#issuecomment-1426299770,https://api.github.com/repos/pydata/xarray/issues/7463,1426299770,IC_kwDOAMm_X85VA5t6,4160723,2023-02-10T20:25:12Z,2023-02-10T20:25:12Z,MEMBER,"I think that the reverting change in IndexVariable came after refactoring copy in Xarray introduced some performance regression (https://github.com/pydata/xarray/pull/7209#issuecomment-1305593478).
I didn't see #1463 (https://github.com/pydata/xarray/issues/1463#issuecomment-340454702), though. It feels weird to me that we can mutate an IndexVariable via its `data` property, considering that the underlying index is immutable. IIUC `xarr2.x.data[0] = 45` replaces the full index with a new one? I'm not sure if it is a good idea to allow this. For a pandas index that's probably OK (it is reasonably cheap to rebuild a new index) but for a custom index that is expensive to build (e.g., kd-tree) I don't think this behavior is desirable.
","{""total_count"": 0, ""+1"": 0, ""-1"": 0, ""laugh"": 0, ""hooray"": 0, ""confused"": 0, ""heart"": 0, ""rocket"": 0, ""eyes"": 0}",,1550792876