Skip to content

Commit ad082dd

Browse files
committed
add tests and minor changes
1 parent dcf0b3a commit ad082dd

File tree

4 files changed

+20
-7
lines changed

4 files changed

+20
-7
lines changed

python/deltalake/_internal.pyi

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ class RawDeltaTable:
3535
@staticmethod
3636
def load_lazy(
3737
table_uri: str,
38-
version: Optional[int],
3938
storage_options: Optional[Dict[str, str]],
4039
without_files: bool,
4140
log_buffer_size: Optional[int],

python/deltalake/table.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,6 @@ def __init__(
255255
if lazy_load:
256256
self._table = RawDeltaTable.load_lazy(
257257
str(table_uri),
258-
version=version,
259258
storage_options=storage_options,
260259
without_files=without_files,
261260
log_buffer_size=log_buffer_size,

python/src/lib.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,10 @@ impl RawDeltaTable {
124124
}
125125

126126
#[classmethod]
127-
#[pyo3(signature = (table_uri, version = None, storage_options = None, without_files = false, log_buffer_size = None))]
127+
#[pyo3(signature = (table_uri, storage_options = None, without_files = false, log_buffer_size = None))]
128128
fn load_lazy(
129129
_cls: &PyType,
130130
table_uri: &str,
131-
version: Option<i64>,
132131
storage_options: Option<HashMap<String, String>>,
133132
without_files: bool,
134133
log_buffer_size: Option<usize>,
@@ -138,9 +137,6 @@ impl RawDeltaTable {
138137
if let Some(storage_options) = storage_options {
139138
builder = builder.with_storage_options(storage_options)
140139
}
141-
if let Some(version) = version {
142-
builder = builder.with_version(version)
143-
}
144140
if without_files {
145141
builder = builder.without_files()
146142
}

python/tests/test_table_read.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,25 @@ def test_read_simple_table_using_options_to_dict():
6363
assert dt.to_pyarrow_dataset().to_table().to_pydict() == {"value": [1, 2, 3]}
6464

6565

66+
def test_simple_table_lazy_loading():
67+
table_path = "../crates/deltalake-core/tests/data/simple_table"
68+
dt = DeltaTable(table_path, lazy_load=True)
69+
dt.load_version(2)
70+
assert dt.version() == 2
71+
72+
73+
def test_simple_table_lazy_loading_with_options():
74+
table_path = "../crates/deltalake-core/tests/data/simple_table"
75+
dt = DeltaTable(
76+
table_path,
77+
storage_options={},
78+
without_files=False,
79+
log_buffer_size=1,
80+
lazy_load=True,
81+
)
82+
assert isinstance(dt, DeltaTable)
83+
84+
6685
def test_load_with_datetime():
6786
log_dir = "../crates/deltalake-core/tests/data/simple_table/_delta_log"
6887
log_mtime_pair = [

0 commit comments

Comments
 (0)