Skip to content

Commit

Permalink
update zarr pin to v3.0.0b1 (#302)
Browse files Browse the repository at this point in the history
* update zarr pin

* Sync normalize path test from zarr 3 test suite

---------

Co-authored-by: Matthew Iannucci <[email protected]>
  • Loading branch information
jhamman and mpiannucci authored Oct 21, 2024
1 parent 6ef42f1 commit d2f0407
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion icechunk-python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
license = { text = "Apache-2.0" }
dynamic = ["version"]

dependencies = ["zarr==3.0.0b0"]
dependencies = ["zarr==3.0.0b1"]

[tool.poetry]
name = "icechunk"
Expand Down
19 changes: 18 additions & 1 deletion icechunk-python/tests/test_zarr/test_api.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import pathlib
from typing import Literal

import numpy as np
import pytest
import zarr
from icechunk import IcechunkStore
from numpy.testing import assert_array_equal
from zarr import Array, Group
from zarr import Array, Group, group
from zarr.abc.store import Store
from zarr.api.synchronous import (
create,
Expand All @@ -16,6 +17,7 @@
save_array,
save_group,
)
from zarr.storage._utils import normalize_path

from ..conftest import parse_store

Expand Down Expand Up @@ -46,6 +48,21 @@ def test_create_array(memory_store: Store) -> None:
assert z.chunks == (40,)


@pytest.mark.parametrize("path", ["foo", "/", "/foo", "///foo/bar"])
@pytest.mark.parametrize("node_type", ["array", "group"])
def test_open_normalized_path(
memory_store: IcechunkStore, path: str, node_type: Literal["array", "group"]
) -> None:
node: Group | Array
if node_type == "group":
node = group(store=memory_store, path=path)
elif node_type == "array":
node = create(store=memory_store, path=path, shape=(2,))

assert node.path == normalize_path(path)



async def test_open_array(memory_store: IcechunkStore) -> None:
store = memory_store

Expand Down

0 comments on commit d2f0407

Please sign in to comment.