Skip to content
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

deprecate(chunkstore): add deprecation warning for chunk_store kwarg #2496

Open
wants to merge 2 commits into
base: support/v2
Choose a base branch
from
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions docs/release.rst
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ Maintenance
Deprecations
~~~~~~~~~~~~

* Deprecate ``chunk_store`` argument to ``Array`` and ``Group`` constructors.
By :user:`Joe Hamman <jhamman>` :issue:`2495`.

.. _release_2.18.3:

2.18.3
Expand Down
11 changes: 11 additions & 0 deletions zarr/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import math
import operator
import re
import warnings
from functools import reduce
from typing import Any

Expand Down Expand Up @@ -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 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
for more information.
synchronizer : object, optional
Array synchronizer.
cache_metadata : bool, optional
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions zarr/creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
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.
Expand Down
11 changes: 11 additions & 0 deletions zarr/hierarchy.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import warnings
from collections.abc import MutableMapping
from itertools import islice

Expand Down Expand Up @@ -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 <https://github.com/zarr-developers/zarr-python/issues/2495>`_
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
Expand Down Expand Up @@ -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
Expand Down
Loading