Skip to content

Commit

Permalink
Python configuration for manifest preload
Browse files Browse the repository at this point in the history
(and some other typing fixes)
  • Loading branch information
paraseba committed Jan 30, 2025
1 parent 1a5f17e commit e7cfb09
Show file tree
Hide file tree
Showing 7 changed files with 346 additions and 28 deletions.
6 changes: 6 additions & 0 deletions icechunk-python/python/icechunk/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
GcsStaticCredentials,
GCSummary,
IcechunkError,
ManifestConfig,
ManifestPreloadCondition,
ManifestPreloadConfig,
ObjectStoreConfig,
RebaseFailedData,
RepositoryConfig,
Expand Down Expand Up @@ -91,6 +94,9 @@
"GcsStaticCredentials",
"IcechunkError",
"IcechunkStore",
"ManifestConfig",
"ManifestPreloadCondition",
"ManifestPreloadConfig",
"ObjectStoreConfig",
"RebaseFailedData",
"RebaseFailedError",
Expand Down
63 changes: 61 additions & 2 deletions icechunk-python/python/icechunk/_icechunk_python.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,59 @@ class CachingConfig:
@staticmethod
def default() -> CachingConfig: ...

class ManifestPreloadCondition:
"""Configuration for conditions under which manifests will preload on session creation"""

@staticmethod
def or_conditions(
conditions: list[ManifestPreloadCondition],
) -> ManifestPreloadCondition: ...
@staticmethod
def and_conditions(
conditions: list[ManifestPreloadCondition],
) -> ManifestPreloadCondition: ...
@staticmethod
def path_matches(regex: str) -> ManifestPreloadCondition: ...
@staticmethod
def name_matches(regex: str) -> ManifestPreloadCondition: ...
@staticmethod
def num_refs(
from_refs: int | None, to_refs: int | None
) -> ManifestPreloadCondition: ...
@staticmethod
def true() -> ManifestPreloadCondition: ...
@staticmethod
def false() -> ManifestPreloadCondition: ...

class ManifestPreloadConfig:
"""Configuration for how Icechunk manifest preload on session creation"""

def __init__(
self,
max_total_refs: int | None = None,
preload_if: ManifestPreloadCondition | None = None,
) -> None: ...
@property
def max_total_refs(self) -> int | None: ...
@max_total_refs.setter
def max_total_refs(self, value: int | None) -> None: ...
@property
def preload_if(self) -> ManifestPreloadCondition | None: ...
@preload_if.setter
def preload_if(self, value: ManifestPreloadCondition | None) -> None: ...

class ManifestConfig:
"""Configuration for how Icechunk manifests"""

def __init__(
self,
preload: ManifestPreloadConfig | None = None,
) -> None: ...
@property
def preload(self) -> ManifestPreloadConfig | None: ...
@preload.setter
def preload(self, value: ManifestPreloadConfig | None) -> None: ...

class StorageConcurrencySettings:
"""Configuration for how Icechunk uses its Storage instance"""

Expand Down Expand Up @@ -150,6 +203,7 @@ class RepositoryConfig:
caching: CachingConfig | None = None,
storage: StorageSettings | None = None,
virtual_chunk_containers: dict[str, VirtualChunkContainer] | None = None,
manifest: ManifestConfig | None = None,
) -> None: ...
@staticmethod
def default() -> RepositoryConfig: ...
Expand All @@ -174,9 +228,13 @@ class RepositoryConfig:
@caching.setter
def caching(self, value: CachingConfig | None) -> None: ...
@property
def storage(self) -> Storage | None: ...
def storage(self) -> StorageSettings | None: ...
@storage.setter
def storage(self, value: Storage | None) -> None: ...
def storage(self, value: StorageSettings | None) -> None: ...
@property
def manifest(self) -> ManifestConfig | None: ...
@manifest.setter
def manifest(self, value: ManifestConfig | None) -> None: ...
@property
def virtual_chunk_containers(self) -> dict[str, VirtualChunkContainer] | None: ...
def get_virtual_chunk_container(self, name: str) -> VirtualChunkContainer | None: ...
Expand Down Expand Up @@ -519,6 +577,7 @@ class Storage:
*,
config: dict[str, str] | None = None,
) -> Storage: ...
def default_settings(self) -> StorageSettings: ...

class VersionSelection(Enum):
"""Enum for selecting the which version of a conflict"""
Expand Down
Loading

0 comments on commit e7cfb09

Please sign in to comment.