You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently this raises a very uninformative error message:
In [1]: from xarray.core.datatree import DataTree
In [2]: tree = DataTree()
In [3]: tree['x'] = 1
In [4]: tree
Out[4]:
<xarray.DataTree>
Group: /
Dimensions: ()
Data variables:
x int64 8B 1
In [5]: del tree['x']
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[5], line 1
----> 1 del tree['x']
File ~/dev/xarray/xarray/core/treenode.py:563, in TreeNode.__delitem__(self, key)
561 child.orphan()
562 else:
--> 563 raise KeyError("Cannot delete")
KeyError: 'Cannot delete'
What did you expect to happen?
The variable 'x' should be deleted, consistent with __getitem__. Short of that, we should raise an informative error message about why this isn't possible.
The text was updated successfully, but these errors were encountered:
What happened?
Currently this raises a very uninformative error message:
What did you expect to happen?
The variable
'x'
should be deleted, consistent with__getitem__
. Short of that, we should raise an informative error message about why this isn't possible.The text was updated successfully, but these errors were encountered: