Skip to content

Commit f895dc1

Browse files
authored
Remove redundant check in IndexVariable (#8320)
* IndexVariable can only have pandasindexadapter * Update variable.py
1 parent df0ddaf commit f895dc1

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

xarray/core/variable.py

+1-7
Original file line numberDiff line numberDiff line change
@@ -2787,13 +2787,7 @@ def copy(self, deep: bool = True, data: T_DuckArray | ArrayLike | None = None):
27872787
data copied from original.
27882788
"""
27892789
if data is None:
2790-
data_old = self._data
2791-
2792-
if not isinstance(data_old, indexing.MemoryCachedArray):
2793-
ndata = data_old
2794-
else:
2795-
# don't share caching between copies
2796-
ndata = indexing.MemoryCachedArray(data_old.array)
2790+
ndata = self._data
27972791

27982792
if deep:
27992793
ndata = copy.deepcopy(ndata, None)

0 commit comments

Comments
 (0)