Skip to content

Commit 26d2db5

Browse files
committed
Ensure zarr v2 kwarg present and correct
1 parent 8fa4b68 commit 26d2db5

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/mdio/core/v1/_overloads.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ def to_mdio(
2525
) -> None:
2626
"""Alias for `.to_zarr()`, prints a greeting, and writes to Zarr store."""
2727
print("👋 hello world from mdio.to_mdio!")
28+
# Ensure zarr_version=2 by default unless explicitly overridden
29+
zarr_version = kwargs.get("zarr_version", 2)
30+
if zarr_version != 2:
31+
raise ValueError("MDIO only supports zarr_version=2")
32+
kwargs["zarr_version"] = zarr_version
2833
return super().to_zarr(*args, store=store, **kwargs)
2934

3035

@@ -41,6 +46,11 @@ def to_mdio(
4146
) -> None:
4247
"""Alias for `.to_zarr()`, prints a greeting, and writes to Zarr store."""
4348
print("👋 hello world from mdio.to_mdio!")
49+
# Ensure zarr_version=2 by default unless explicitly overridden
50+
zarr_version = kwargs.get("zarr_version", 2)
51+
if zarr_version != 2:
52+
raise ValueError("MDIO only supports zarr_version=2")
53+
kwargs["zarr_version"] = zarr_version
4454
return super().to_zarr(*args, store=store, **kwargs)
4555

4656

0 commit comments

Comments
 (0)