Skip to content

Commit 96ee671

Browse files
committed
deprecate(chunkstore): add deprecation warning for chunk_store kwarg
1 parent ed94877 commit 96ee671

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

zarr/core.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
import math
55
import operator
66
import re
7+
import warnings
78
from functools import reduce
89
from typing import Any
910

@@ -78,6 +79,10 @@ class Array:
7879
chunk_store : MutableMapping, optional
7980
Separate storage for chunks. If not provided, `store` will be used
8081
for storage of both chunks and metadata.
82+
[DEPRECATED since version 2.18.4] This argument is deprecated and will be
83+
removed in version 3.0. See
84+
`GH2495 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
85+
for more information.
8186
synchronizer : object, optional
8287
Array synchronizer.
8388
cache_metadata : bool, optional
@@ -139,6 +144,12 @@ def __init__(
139144
assert_zarr_v3_api_available()
140145

141146
if chunk_store is not None:
147+
warnings.warn(
148+
"chunk_store is deprecated and will be removed in a Zarr-Python version 3, see "
149+
"https://github.com/zarr-developers/zarr-python/issues/2495 for more information.",
150+
FutureWarning,
151+
stacklevel=2,
152+
)
142153
chunk_store = normalize_store_arg(chunk_store, zarr_version=zarr_version)
143154

144155
self._store = store

zarr/creation.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -519,6 +519,10 @@ def open_array(
519519
A codec to encode object arrays, only needed if dtype=object.
520520
chunk_store : MutableMapping or string, optional
521521
Store or path to directory in file system or name of zip file.
522+
[DEPRECATED since version 2.18.4] This argument is deprecated and will be
523+
removed in version 3.0. See
524+
`GH2495 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
525+
for more information.
522526
storage_options : dict
523527
If using an fsspec URL to create the store, these will be passed to
524528
the backend implementation. Ignored otherwise.

zarr/hierarchy.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import warnings
12
from collections.abc import MutableMapping
23
from itertools import islice
34

@@ -73,6 +74,10 @@ class Group(MutableMapping):
7374
chunk_store : MutableMapping, optional
7475
Separate storage for chunks. If not provided, `store` will be used
7576
for storage of both chunks and metadata.
77+
[DEPRECATED since version 2.18.4] This argument is deprecated and will be
78+
removed in version 3.0. See
79+
`GH2495 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
80+
for more information.
7681
cache_attrs : bool, optional
7782
If True (default), user attributes will be cached for attribute read
7883
operations. If False, user attributes are reloaded from the store prior
@@ -156,6 +161,12 @@ def __init__(
156161
assert_zarr_v3_api_available()
157162

158163
if chunk_store is not None:
164+
warnings.warn(
165+
"chunk_store is deprecated and will be removed in a Zarr-Python version 3, see "
166+
"https://github.com/zarr-developers/zarr-python/issues/2495 for more information.",
167+
FutureWarning,
168+
stacklevel=2,
169+
)
159170
chunk_store: BaseStore = _normalize_store_arg(chunk_store, zarr_version=zarr_version)
160171
self._store = store
161172
self._chunk_store = chunk_store

0 commit comments

Comments
 (0)