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

Lines changed: 1 addition & 7 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy