Skip to content

Commit

Permalink
tiny reordering
Browse files Browse the repository at this point in the history
  • Loading branch information
dcherian committed Oct 29, 2024
1 parent 0f93237 commit 82ca5be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions xarray/backends/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -2132,6 +2132,9 @@ def to_zarr(
"""
from xarray.backends.zarr import _choose_default_mode, _get_mappers

# validate Dataset keys, DataArray names
_validate_dataset_names(dataset)

# Load empty arrays to avoid bug saving zero length dimensions (Issue #5741)
for v in dataset.variables.values():
if v.size == 0:
Expand All @@ -2145,9 +2148,6 @@ def to_zarr(
)
mode = _choose_default_mode(mode=mode, append_dim=append_dim, region=region)

# validate Dataset keys, DataArray names
_validate_dataset_names(dataset)

if mode == "r+":
already_consolidated = consolidated
consolidate_on_close = False
Expand Down

0 comments on commit 82ca5be

Please sign in to comment.