From 96ee671e02263213194675fbdbc558dab28fb461 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Sun, 17 Nov 2024 05:52:02 -0800 Subject: [PATCH 1/2] deprecate(chunkstore): add deprecation warning for chunk_store kwarg --- zarr/core.py | 11 +++++++++++ zarr/creation.py | 4 ++++ zarr/hierarchy.py | 11 +++++++++++ 3 files changed, 26 insertions(+) diff --git a/zarr/core.py b/zarr/core.py index d13da27bc6..378a03640e 100644 --- a/zarr/core.py +++ b/zarr/core.py @@ -4,6 +4,7 @@ import math import operator import re +import warnings from functools import reduce from typing import Any @@ -78,6 +79,10 @@ class Array: chunk_store : MutableMapping, optional Separate storage for chunks. If not provided, `store` will be used for storage of both chunks and metadata. + [DEPRECATED since version 2.18.4] This argument is deprecated and will be + removed in version 3.0. See + `GH2495 `_ + for more information. synchronizer : object, optional Array synchronizer. cache_metadata : bool, optional @@ -139,6 +144,12 @@ def __init__( assert_zarr_v3_api_available() if chunk_store is not None: + warnings.warn( + "chunk_store is deprecated and will be removed in a Zarr-Python version 3, see " + "https://github.com/zarr-developers/zarr-python/issues/2495 for more information.", + FutureWarning, + stacklevel=2, + ) chunk_store = normalize_store_arg(chunk_store, zarr_version=zarr_version) self._store = store diff --git a/zarr/creation.py b/zarr/creation.py index f7f3d5a094..9d5f701da6 100644 --- a/zarr/creation.py +++ b/zarr/creation.py @@ -519,6 +519,10 @@ def open_array( A codec to encode object arrays, only needed if dtype=object. chunk_store : MutableMapping or string, optional Store or path to directory in file system or name of zip file. + [DEPRECATED since version 2.18.4] This argument is deprecated and will be + removed in version 3.0. See + `GH2495 `_ + for more information. storage_options : dict If using an fsspec URL to create the store, these will be passed to the backend implementation. Ignored otherwise. diff --git a/zarr/hierarchy.py b/zarr/hierarchy.py index 8894a5ed57..5c89638d58 100644 --- a/zarr/hierarchy.py +++ b/zarr/hierarchy.py @@ -1,3 +1,4 @@ +import warnings from collections.abc import MutableMapping from itertools import islice @@ -73,6 +74,10 @@ class Group(MutableMapping): chunk_store : MutableMapping, optional Separate storage for chunks. If not provided, `store` will be used for storage of both chunks and metadata. + [DEPRECATED since version 2.18.4] This argument is deprecated and will be + removed in version 3.0. See + `GH2495 `_ + for more information. cache_attrs : bool, optional If True (default), user attributes will be cached for attribute read operations. If False, user attributes are reloaded from the store prior @@ -156,6 +161,12 @@ def __init__( assert_zarr_v3_api_available() if chunk_store is not None: + warnings.warn( + "chunk_store is deprecated and will be removed in a Zarr-Python version 3, see " + "https://github.com/zarr-developers/zarr-python/issues/2495 for more information.", + FutureWarning, + stacklevel=2, + ) chunk_store: BaseStore = _normalize_store_arg(chunk_store, zarr_version=zarr_version) self._store = store self._chunk_store = chunk_store From dc69e0ddcf7520eb0c3c37e785ab2bda32413fa8 Mon Sep 17 00:00:00 2001 From: Joseph Hamman Date: Sun, 17 Nov 2024 06:01:36 -0800 Subject: [PATCH 2/2] release note --- docs/release.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/release.rst b/docs/release.rst index 74207d92d1..326da9862f 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -40,6 +40,9 @@ Maintenance Deprecations ~~~~~~~~~~~~ +* Deprecate ``chunk_store`` argument to ``Array`` and ``Group`` constructors. + By :user:`Joe Hamman ` :issue:`2495`. + .. _release_2.18.3: 2.18.3