diff --git a/python/deltalake/_internal.pyi b/python/deltalake/_internal.pyi index fd1e5bfa5c..353b5a6a91 100644 --- a/python/deltalake/_internal.pyi +++ b/python/deltalake/_internal.pyi @@ -35,7 +35,6 @@ class RawDeltaTable: @staticmethod def load_lazy( table_uri: str, - version: Optional[int], storage_options: Optional[Dict[str, str]], without_files: bool, log_buffer_size: Optional[int], diff --git a/python/deltalake/table.py b/python/deltalake/table.py index 95fddc1975..74e2d1e439 100644 --- a/python/deltalake/table.py +++ b/python/deltalake/table.py @@ -255,7 +255,6 @@ def __init__( if lazy_load: self._table = RawDeltaTable.load_lazy( str(table_uri), - version=version, storage_options=storage_options, without_files=without_files, log_buffer_size=log_buffer_size, diff --git a/python/src/lib.rs b/python/src/lib.rs index e448a9ebda..1221e89306 100644 --- a/python/src/lib.rs +++ b/python/src/lib.rs @@ -124,11 +124,10 @@ impl RawDeltaTable { } #[classmethod] - #[pyo3(signature = (table_uri, version = None, storage_options = None, without_files = false, log_buffer_size = None))] + #[pyo3(signature = (table_uri, storage_options = None, without_files = false, log_buffer_size = None))] fn load_lazy( _cls: &PyType, table_uri: &str, - version: Option, storage_options: Option>, without_files: bool, log_buffer_size: Option, @@ -138,9 +137,6 @@ impl RawDeltaTable { if let Some(storage_options) = storage_options { builder = builder.with_storage_options(storage_options) } - if let Some(version) = version { - builder = builder.with_version(version) - } if without_files { builder = builder.without_files() } diff --git a/python/tests/test_table_read.py b/python/tests/test_table_read.py index a49374e710..8cb6e6fda2 100644 --- a/python/tests/test_table_read.py +++ b/python/tests/test_table_read.py @@ -63,6 +63,25 @@ def test_read_simple_table_using_options_to_dict(): assert dt.to_pyarrow_dataset().to_table().to_pydict() == {"value": [1, 2, 3]} +def test_simple_table_lazy_loading(): + table_path = "../crates/deltalake-core/tests/data/simple_table" + dt = DeltaTable(table_path, lazy_load=True) + dt.load_version(2) + assert dt.version() == 2 + + +def test_simple_table_lazy_loading_with_options(): + table_path = "../crates/deltalake-core/tests/data/simple_table" + dt = DeltaTable( + table_path, + storage_options={}, + without_files=False, + log_buffer_size=1, + lazy_load=True, + ) + assert isinstance(dt, DeltaTable) + + def test_load_with_datetime(): log_dir = "../crates/deltalake-core/tests/data/simple_table/_delta_log" log_mtime_pair = [