diff --git a/doc/whats-new.rst b/doc/whats-new.rst index e73a1a7fa62..fb1c07f0616 100644 --- a/doc/whats-new.rst +++ b/doc/whats-new.rst @@ -30,6 +30,10 @@ New Features Breaking changes ~~~~~~~~~~~~~~~~ +- :py:meth:`Dataset.to_zarr` & :py:meth:`DataArray.to_zarr` require keyword + arguments after the initial 7 positional arguments. + By `Maximilian Roos `_. + Deprecations ~~~~~~~~~~~~ diff --git a/xarray/backends/api.py b/xarray/backends/api.py index 7ca4377e4cf..27e155872de 100644 --- a/xarray/backends/api.py +++ b/xarray/backends/api.py @@ -1528,6 +1528,7 @@ def to_zarr( synchronizer=None, group: str | None = None, encoding: Mapping | None = None, + *, compute: Literal[True] = True, consolidated: bool | None = None, append_dim: Hashable | None = None, @@ -1573,6 +1574,7 @@ def to_zarr( synchronizer=None, group: str | None = None, encoding: Mapping | None = None, + *, compute: bool = True, consolidated: bool | None = None, append_dim: Hashable | None = None, diff --git a/xarray/core/dataarray.py b/xarray/core/dataarray.py index ef4389f3c6c..904688d7df9 100644 --- a/xarray/core/dataarray.py +++ b/xarray/core/dataarray.py @@ -4010,6 +4010,7 @@ def to_zarr( mode: Literal["w", "w-", "a", "r+", None] = None, synchronizer=None, group: str | None = None, + *, encoding: Mapping | None = None, compute: Literal[True] = True, consolidated: bool | None = None, @@ -4050,6 +4051,7 @@ def to_zarr( synchronizer=None, group: str | None = None, encoding: Mapping | None = None, + *, compute: bool = True, consolidated: bool | None = None, append_dim: Hashable | None = None, diff --git a/xarray/core/dataset.py b/xarray/core/dataset.py index 459e2f3fce7..ef27071eace 100644 --- a/xarray/core/dataset.py +++ b/xarray/core/dataset.py @@ -2293,6 +2293,7 @@ def to_zarr( synchronizer=None, group: str | None = None, encoding: Mapping | None = None, + *, compute: Literal[True] = True, consolidated: bool | None = None, append_dim: Hashable | None = None, @@ -2336,6 +2337,7 @@ def to_zarr( synchronizer=None, group: str | None = None, encoding: Mapping | None = None, + *, compute: bool = True, consolidated: bool | None = None, append_dim: Hashable | None = None,