Repository: earth-mover/icechunk (language: python)

Issue:
Update `zarr-python` dependency to `3.0.0a7`



Discussion / hints:

Fix patch:
diff --git a/icechunk-python/pyproject.toml b/icechunk-python/pyproject.toml
index cf193702..f0ee68d9 100644
--- a/icechunk-python/pyproject.toml
+++ b/icechunk-python/pyproject.toml
@@ -12,7 +12,7 @@ classifiers = [
 ]
 dynamic = ["version"]
 
-dependencies = ["zarr==3.0.0a6"]
+dependencies = ["zarr==3.0.0a7"]
 
 [project.optional-dependencies]
 test = [


Test patch:
diff --git a/icechunk-python/tests/test_pickle.py b/icechunk-python/tests/test_pickle.py
index 4bfe21fb..ee02fdff 100644
--- a/icechunk-python/tests/test_pickle.py
+++ b/icechunk-python/tests/test_pickle.py
@@ -2,7 +2,7 @@
 
 import pytest
 import zarr
-from zarr.store.local import LocalStore
+from zarr.storage import LocalStore
 
 import icechunk
 
diff --git a/icechunk-python/tests/test_zarr/test_array.py b/icechunk-python/tests/test_zarr/test_array.py
index e7dee8b4..31e5fe4e 100644
--- a/icechunk-python/tests/test_zarr/test_array.py
+++ b/icechunk-python/tests/test_zarr/test_array.py
@@ -10,7 +10,7 @@
 import zarr.api.asynchronous
 from zarr.core.common import ZarrFormat
 from zarr.errors import ContainsArrayError, ContainsGroupError
-from zarr.store.common import StorePath
+from zarr.storage import StorePath
 
 
 @pytest.mark.parametrize("store", ["memory"], indirect=["store"])
@@ -88,10 +88,9 @@ async def test_create_creates_parents(
     expected = [f"{part}/{file}" for file in files for part in parts]
 
     if zarr_format == 2:
-        expected.append("a/b/c/d/.zarray")
-        expected.append("a/b/c/d/.zattrs")
+        expected.extend([".zattrs", ".zgroup", "a/b/c/d/.zarray", "a/b/c/d/.zattrs"])
     else:
-        expected.append("a/b/c/d/zarr.json")
+        expected.extend(["zarr.json", "a/b/c/d/zarr.json"])
 
     expected = sorted(expected)
 
diff --git a/icechunk-python/tests/test_zarr/test_group.py b/icechunk-python/tests/test_zarr/test_group.py
index 90118728..2fad26b0 100644
--- a/icechunk-python/tests/test_zarr/test_group.py
+++ b/icechunk-python/tests/test_zarr/test_group.py
@@ -15,8 +15,7 @@
 from zarr.core.group import GroupMetadata
 from zarr.core.sync import sync
 from zarr.errors import ContainsArrayError, ContainsGroupError
-from zarr.store import StorePath
-from zarr.store.common import make_store_path
+from zarr.storage import StorePath, make_store_path
 
 from ..conftest import parse_store
 
@@ -66,6 +65,20 @@ async def test_create_creates_parents(
     await zarr.api.asynchronous.open_group(
         store=store, path="a", zarr_format=zarr_format, attributes={"key": "value"}
     )
+    objs = {x async for x in store.list()}
+    if zarr_format == 2:
+        assert objs == {".zgroup", ".zattrs", "a/.zgroup", "a/.zattrs"}
+    else:
+        assert objs == {"zarr.json", "a/zarr.json"}
+
+    # test that root group node was created
+    root = await zarr.api.asynchronous.open_group(
+        store=store,
+    )
+
+    agroup = await root.getitem("a")
+    assert agroup.attrs == {"key": "value"}
+
     # create a child node with a couple intermediates
     await zarr.api.asynchronous.open_group(
         store=store, path="a/b/c/d", zarr_format=zarr_format
@@ -80,10 +93,9 @@ async def test_create_creates_parents(
     expected = [f"{part}/{file}" for file in files for part in parts]
 
     if zarr_format == 2:
-        expected.append("a/b/c/d/.zgroup")
-        expected.append("a/b/c/d/.zattrs")
+        expected.extend([".zgroup", ".zattrs", "a/b/c/d/.zgroup", "a/b/c/d/.zattrs"])
     else:
-        expected.append("a/b/c/d/zarr.json")
+        expected.extend(["zarr.json", "a/b/c/d/zarr.json"])
 
     expected = sorted(expected)
 
@@ -248,12 +260,7 @@ def test_group_create(
 
     if not exists_ok:
         with pytest.raises(ContainsGroupError):
-            group = Group.from_store(
-                store,
-                attributes=attributes,
-                exists_ok=exists_ok,
-                zarr_format=zarr_format,
-            )
+            _ = Group.from_store(store, exists_ok=exists_ok, zarr_format=zarr_format)
 
 
 def test_group_open(
@@ -334,8 +341,7 @@ def test_group_iter(store: IcechunkStore, zarr_format: ZarrFormat) -> None:
     """
 
     group = Group.from_store(store, zarr_format=zarr_format)
-    with pytest.raises(NotImplementedError):
-        [x for x in group]  # type: ignore
+    assert list(group) == []
 
 
 def test_group_len(store: IcechunkStore, zarr_format: ZarrFormat) -> None:
@@ -344,8 +350,7 @@ def test_group_len(store: IcechunkStore, zarr_format: ZarrFormat) -> None:
     """
 
     group = Group.from_store(store, zarr_format=zarr_format)
-    with pytest.raises(NotImplementedError):
-        len(group)
+    assert len(group) == 0
 
 
 def test_group_setitem(store: IcechunkStore, zarr_format: ZarrFormat) -> None:
@@ -909,3 +914,14 @@ async def test_require_array(store: IcechunkStore, zarr_format: ZarrFormat) -> N
     _ = await root.create_group("bar")
     with pytest.raises(TypeError, match="Incompatible object"):
         await root.require_array("bar", shape=(10,), dtype="int8")
+
+class TestGroupMetadata:
+    def test_from_dict_extra_fields(self):
+        data = {
+            "attributes": {"key": "value"},
+            "_nczarr_superblock": {"version": "2.0.0"},
+            "zarr_format": 2,
+        }
+        result = GroupMetadata.from_dict(data)
+        expected = GroupMetadata(attributes={"key": "value"}, zarr_format=2)
+        assert result == expected
diff --git a/icechunk-python/tests/test_zarr/test_store/test_core.py b/icechunk-python/tests/test_zarr/test_store/test_core.py
index 525bfc55..4a334ffc 100644
--- a/icechunk-python/tests/test_zarr/test_store/test_core.py
+++ b/icechunk-python/tests/test_zarr/test_store/test_core.py
@@ -1,6 +1,6 @@
 from icechunk import IcechunkStore
 
-from zarr.store.common import make_store_path
+from zarr.storage import make_store_path
 
 from ...conftest import parse_store