Skip to content

Commit 79d2c41

Browse files
parasebadstansby
andauthored
Update docstrings
Co-authored-by: David Stansby <[email protected]>
1 parent 65f43b1 commit 79d2c41

File tree

4 files changed

+11
-12
lines changed

4 files changed

+11
-12
lines changed

src/zarr/abc/store.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,11 +267,11 @@ async def _set_many(self, values: Iterable[tuple[str, Buffer]]) -> None:
267267
@property
268268
def supports_consolidated_metadata(self) -> bool:
269269
"""
270-
Does the store support and benefit from consolidated metadata?.
270+
Does the store support consolidated metadata?.
271271
272-
If it doesn't Zarr will ignore requests to consolidate the metadata.
273-
Stores that would return `True` are the ones that implement their own
274-
consolidation mechanism, that allows fast querying of metadata keys.
272+
If it doesn't an error will be raised on requests to consolidate the metadata.
273+
Returning `False` can be useful for stores which implement their own
274+
consolidation mechanism outside of the zarr-python implementation.
275275
"""
276276

277277
return True

src/zarr/api/asynchronous.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ async def consolidate_metadata(
174174
Consolidate the metadata of all nodes in a hierarchy.
175175
176176
Upon completion, the metadata of the root node in the Zarr hierarchy will be
177-
updated to include all the metadata of child nodes. For Stores that prefer
178-
not to use consolidated metadata, this operation raises a ``TypeError``.
177+
updated to include all the metadata of child nodes. For Stores that do
178+
not support consolidated metadata, this operation raises a ``TypeError``.
179179
180180
Parameters
181181
----------
@@ -195,9 +195,8 @@ async def consolidate_metadata(
195195
-------
196196
group: AsyncGroup
197197
The group, with the ``consolidated_metadata`` field set to include
198-
the metadata of each child node. If the Store doesn't prefer
199-
consolidated metadata, this is function does nothing and returns
200-
the group without modifications. See ``Store.supports_consolidated_metadata``.
198+
the metadata of each child node. If the Store doesn't support
199+
consolidated metadata, this is function does raises a `TypeError`.
201200
"""
202201
store_path = await make_store_path(store, path=path)
203202

src/zarr/api/synchronous.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ def consolidate_metadata(
8181
Consolidate the metadata of all nodes in a hierarchy.
8282
8383
Upon completion, the metadata of the root node in the Zarr hierarchy will be
84-
updated to include all the metadata of child nodes. For Stores that prefer
85-
not to use consolidated metadata, this operation does nothing.
84+
updated to include all the metadata of child nodes. For Stores that do
85+
not use consolidated metadata, this operation raises a `TypeError`.
8686
8787
Parameters
8888
----------

tests/test_metadata/test_consolidated.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -662,7 +662,7 @@ def supports_consolidated_metadata(self) -> bool:
662662

663663

664664
async def test_consolidate_metadata_raises_for_self_consolidating_stores():
665-
"""Verify calling consolidate_metadata on a non supporting stores does nothing"""
665+
"""Verify calling consolidate_metadata on a non supporting stores raises an error."""
666666

667667
memory_store = NonConsolidatedStore()
668668
root = await zarr.api.asynchronous.create_group(store=memory_store)

0 commit comments

Comments
 (0)