From a13459b118e2d7eb0774f398064bdab34997b5c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Galkin?= Date: Fri, 24 Jan 2025 11:27:59 -0300 Subject: [PATCH] Release 0.1.0-alpha.15 (#617) --- Cargo.lock | 4 ++-- Changelog.python.md | 6 +++++ icechunk-python/Cargo.toml | 4 ++-- .../python/icechunk/_icechunk_python.pyi | 10 +++++++++ icechunk-python/src/config.rs | 22 +++++++++++++++++++ icechunk-python/tests/test_config.py | 6 ++++- icechunk/Cargo.toml | 2 +- 7 files changed, 48 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8388d9859..659bbce29 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1318,7 +1318,7 @@ dependencies = [ [[package]] name = "icechunk" -version = "0.1.0-alpha.14" +version = "0.1.0-alpha.15" dependencies = [ "async-recursion", "async-stream", @@ -1359,7 +1359,7 @@ dependencies = [ [[package]] name = "icechunk-python" -version = "0.1.0-alpha.14" +version = "0.1.0-alpha.15" dependencies = [ "async-stream", "async-trait", diff --git a/Changelog.python.md b/Changelog.python.md index 6b401abf2..8028833ba 100644 --- a/Changelog.python.md +++ b/Changelog.python.md @@ -1,5 +1,11 @@ # Changelog +## Python Icechunk Library 0.1.0a15 + +### Fixes + +- Add a constructor to `RepositoryConfig` + ## Python Icechunk Library 0.1.0a14 ### Features diff --git a/icechunk-python/Cargo.toml b/icechunk-python/Cargo.toml index 81e6d670b..e62dcbd0c 100644 --- a/icechunk-python/Cargo.toml +++ b/icechunk-python/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icechunk-python" -version = "0.1.0-alpha.14" +version = "0.1.0-alpha.15" description = "Transactional storage engine for Zarr designed for use on cloud object storage" readme = "../README.md" repository = "https://github.com/earth-mover/icechunk" @@ -21,7 +21,7 @@ crate-type = ["cdylib"] bytes = "1.9.0" chrono = { version = "0.4.39" } futures = "0.3.31" -icechunk = { path = "../icechunk", version = "0.1.0-alpha.14" } +icechunk = { path = "../icechunk", version = "0.1.0-alpha.15" } pyo3 = { version = "0.23", features = [ "chrono", # do we really need this one? diff --git a/icechunk-python/python/icechunk/_icechunk_python.pyi b/icechunk-python/python/icechunk/_icechunk_python.pyi index 4ac84f8a1..92b4f4615 100644 --- a/icechunk-python/python/icechunk/_icechunk_python.pyi +++ b/icechunk-python/python/icechunk/_icechunk_python.pyi @@ -140,6 +140,16 @@ class StorageSettings: class RepositoryConfig: """Configuration for an Icechunk repository""" + def __init__( + self, + inline_chunk_threshold_bytes: int | None, + unsafe_overwrite_refs: bool | None, + get_partial_values_concurrency: int | None, + compression: CompressionConfig | None, + caching: CachingConfig | None, + storage: StorageSettings | None, + virtual_chunk_containers: dict[str, VirtualChunkContainer] | None, + ) -> None: ... @staticmethod def default() -> RepositoryConfig: ... @property diff --git a/icechunk-python/src/config.rs b/icechunk-python/src/config.rs index 6d84e4823..8145cd396 100644 --- a/icechunk-python/src/config.rs +++ b/icechunk-python/src/config.rs @@ -779,6 +779,28 @@ impl PyRepositoryConfig { RepositoryConfig::default().into() } + #[new] + #[pyo3(signature = (inline_chunk_threshold_bytes = None, unsafe_overwrite_refs = None, get_partial_values_concurrency = None, compression = None, caching = None, storage = None, virtual_chunk_containers = None))] + pub fn new( + inline_chunk_threshold_bytes: Option, + unsafe_overwrite_refs: Option, + get_partial_values_concurrency: Option, + compression: Option>, + caching: Option>, + storage: Option>, + virtual_chunk_containers: Option>, + ) -> Self { + Self { + inline_chunk_threshold_bytes, + unsafe_overwrite_refs, + get_partial_values_concurrency, + compression, + caching, + storage, + virtual_chunk_containers, + } + } + pub fn set_virtual_chunk_container(&mut self, cont: PyVirtualChunkContainer) { // TODO: this is a very ugly way to do it but, it avoids duplicating logic let this: &PyRepositoryConfig = &*self; diff --git a/icechunk-python/tests/test_config.py b/icechunk-python/tests/test_config.py index e7027d9a4..fce5a8b6a 100644 --- a/icechunk-python/tests/test_config.py +++ b/icechunk-python/tests/test_config.py @@ -154,7 +154,11 @@ def test_can_change_deep_config_values() -> None: repo = icechunk.Repository.create( storage=storage, ) - config = icechunk.RepositoryConfig.default() + config = icechunk.RepositoryConfig( + inline_chunk_threshold_bytes=11, + unsafe_overwrite_refs=False, + compression=icechunk.CompressionConfig(level=0), + ) config.inline_chunk_threshold_bytes = 5 config.unsafe_overwrite_refs = True config.get_partial_values_concurrency = 42 diff --git a/icechunk/Cargo.toml b/icechunk/Cargo.toml index a7c3add3f..7553abe1f 100644 --- a/icechunk/Cargo.toml +++ b/icechunk/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "icechunk" -version = "0.1.0-alpha.14" +version = "0.1.0-alpha.15" description = "Transactional storage engine for Zarr designed for use on cloud object storage" readme = "../README.md" repository = "https://github.com/earth-mover/icechunk"