Skip to content

Commit

Permalink
more concise indexes detection
Browse files Browse the repository at this point in the history
  • Loading branch information
slevang committed Nov 14, 2023
1 parent 9eb1b58 commit e1a2cb3
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
from xarray.core.indexes import Index
from xarray.core.parallelcompat import guess_chunkmanager
from xarray.core.utils import is_remote_uri
from xarray.core.variable import IndexVariable

if TYPE_CHECKING:
try:
Expand Down Expand Up @@ -1708,13 +1707,7 @@ def to_zarr(
)
# drop indices to avoid potential race condition with auto region
if region_was_autodetected:
dataset = dataset.drop_vars(
[
name
for name, v in dataset.variables.items()
if isinstance(v, IndexVariable)
]
)
dataset = dataset.drop_vars(dataset.indexes)
if append_dim is not None and append_dim in region:
raise ValueError(
f"cannot list the same dimension in both ``append_dim`` and "
Expand Down

0 comments on commit e1a2cb3

Please sign in to comment.