Skip to content

Commit 79e8f65

Browse files
committed
special path for meta computation
1 parent 7b7f2fe commit 79e8f65

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

icechunk-python/python/icechunk/distributed.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
from collections.abc import Generator, Iterable
33
from typing import Any, cast
44

5+
import numpy as np
56
import zarr
7+
68
from icechunk import IcechunkStore, Session
79

810
__all__ = [
@@ -24,8 +26,13 @@ def _flatten(seq: Iterable[Any], container: type = list) -> Generator[Any, None,
2426

2527

2628
def extract_session(
27-
zarray: zarr.Array, axis: Any = None, keepdims: Any = None
29+
zarray: zarr.Array,
30+
axis: Any = None,
31+
keepdims: Any = None,
32+
computing_meta: bool = False,
2833
) -> Session:
34+
if computing_meta:
35+
return np.array([object()], dtype=object)
2936
store = cast(IcechunkStore, zarray.store)
3037
return store.session
3138

@@ -34,7 +41,10 @@ def merge_sessions(
3441
*sessions: Session | list[Session] | list[list[Session]],
3542
axis: Any = None,
3643
keepdims: Any = None,
44+
computing_meta: bool = False,
3745
) -> Session:
46+
if computing_meta:
47+
return np.array([object()], dtype=object)
3848
session, *rest = list(_flatten(sessions))
3949
for other in rest:
4050
session.merge(other)

0 commit comments

Comments
 (0)