Skip to content

Commit 4808f21

Browse files
authored
Merge branch 'main' into deref-path-errors
2 parents 44b442f + c9eefe6 commit 4808f21

15 files changed

Lines changed: 1070 additions & 192 deletions

File tree

changes/3299.bugfix.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
Fix a bug in ``create_array`` caused by iterating over chunk-aligned regions instead of
2+
shard-aligned regions when writing data. Additionally, the behavior of ``nchunks_initialized``
3+
has been adjusted. This function consistently reports the number of chunks present in stored objects,
4+
even when the array uses the sharding codec.

changes/3367.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `zarr.errors.ArrayNotFoundError`, which is raised when attempting to open a zarr array that does not exist, and `zarr.errors.NodeNotFoundError`, which is raised when failing to open an array or a group in a context where either an array or a group was expected.

changes/3395.bugfix.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Raise a Zarr-specific error class when a codec can't be found by name when deserializing the given codecs. This avoids hiding this error behind a "not part of a zarr hierarchy" warning.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ docs = [
115115

116116

117117
[project.urls]
118-
"Bug Tracker" = "https://github.com/zarr-developers/zarr-python/issues"
119-
Changelog = "https://zarr.readthedocs.io/en/stable/release-notes.html"
118+
issues = "https://github.com/zarr-developers/zarr-python/issues"
119+
changelog = "https://zarr.readthedocs.io/en/stable/release-notes.html"
120120
Discussions = "https://github.com/zarr-developers/zarr-python/discussions"
121-
Documentation = "https://zarr.readthedocs.io/"
122-
Homepage = "https://github.com/zarr-developers/zarr-python"
121+
documentation = "https://zarr.readthedocs.io/"
122+
homepage = "https://github.com/zarr-developers/zarr-python"
123123

124124
[dependency-groups]
125125
dev = [
@@ -352,14 +352,14 @@ module = [
352352
"tests.test_store.test_fsspec",
353353
"tests.test_store.test_memory",
354354
"tests.test_codecs.test_codecs",
355+
"tests.test_metadata.*",
355356
]
356357
strict = false
357358

358359
# TODO: Move the next modules up to the strict = false section
359360
# and fix the errors
360361
[[tool.mypy.overrides]]
361362
module = [
362-
"tests.test_metadata.*",
363363
"tests.test_store.test_core",
364364
"tests.test_store.test_logging",
365365
"tests.test_store.test_object",

src/zarr/api/asynchronous.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
)
4040
from zarr.core.metadata import ArrayMetadataDict, ArrayV2Metadata, ArrayV3Metadata
4141
from zarr.errors import (
42+
ArrayNotFoundError,
4243
GroupNotFoundError,
4344
NodeTypeValidationError,
4445
ZarrDeprecationWarning,
@@ -1257,7 +1258,7 @@ async def open_array(
12571258

12581259
try:
12591260
return await AsyncArray.open(store_path, zarr_format=zarr_format)
1260-
except FileNotFoundError:
1261+
except FileNotFoundError as err:
12611262
if not store_path.read_only and mode in _CREATE_MODES:
12621263
overwrite = _infer_overwrite(mode)
12631264
_zarr_format = zarr_format or _default_zarr_format()
@@ -1267,7 +1268,7 @@ async def open_array(
12671268
overwrite=overwrite,
12681269
**kwargs,
12691270
)
1270-
raise
1271+
raise ArrayNotFoundError(store_path.store, store_path.path) from err
12711272

12721273

12731274
async def open_like(

0 commit comments

Comments
 (0)