Skip to content

Commit

Permalink
expose to python
Browse files Browse the repository at this point in the history
  • Loading branch information
eeroel committed Jul 22, 2023
1 parent fb7b061 commit c8e5a79
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,13 @@ struct RawDeltaTableMetaData {
#[pymethods]
impl RawDeltaTable {
#[new]
#[pyo3(signature = (table_uri, version = None, storage_options = None, without_files = false))]
#[pyo3(signature = (table_uri, version = None, storage_options = None, without_files = false, log_buffer_size = None))]
fn new(
table_uri: &str,
version: Option<i64>,
storage_options: Option<HashMap<String, String>>,
without_files: bool,
log_buffer_size: Option<usize>,
) -> PyResult<Self> {
let mut builder = deltalake::DeltaTableBuilder::from_uri(table_uri);
let options = storage_options.clone().unwrap_or_default();
Expand All @@ -90,10 +91,12 @@ impl RawDeltaTable {
if let Some(version) = version {
builder = builder.with_version(version)
}

if without_files {
builder = builder.without_files()
}
if let Some(buf_size) = log_buffer_size {
builder = builder.with_buffer(buf_size);
}

let table = rt()?.block_on(builder.load()).map_err(PythonError::from)?;
Ok(RawDeltaTable {
Expand Down

0 comments on commit c8e5a79

Please sign in to comment.