Skip to content

Use zarr-python default open mode when opening arrays #10430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions xarray/backends/zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ def open_store(
def open_group(
cls,
store,
mode: ZarrWriteModes = "r",
mode: ZarrWriteModes | None = None,
synchronizer=None,
group=None,
consolidated=False,
Expand Down Expand Up @@ -1561,7 +1561,7 @@ def open_dataset(
use_cftime=None,
decode_timedelta=None,
group=None,
mode="r",
mode=None,
synchronizer=None,
consolidated=None,
chunk_store=None,
Expand Down Expand Up @@ -1746,6 +1746,9 @@ def _get_open_params(
synchronizer=synchronizer,
path=group,
)
if mode is None:
# Let zarr-python use its default open mode
open_kwargs.pop("mode")
open_kwargs["storage_options"] = storage_options

zarr_format = _handle_zarr_version_or_format(
Expand Down
Loading