Skip to content

Commit

Permalink
revert 965968c and 965968c
Browse files Browse the repository at this point in the history
  • Loading branch information
aersam committed Mar 13, 2024
1 parent 83d398f commit 98bf7ec
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1385,20 +1385,6 @@ impl From<&PyAddAction> for Add {
}
}

struct GilIterator {
reader: ArrowArrayStreamReader,
}

impl Iterator for GilIterator {
type Item = RecordBatch;

fn next(&mut self) -> Option<Self::Item> {
let reader = &mut self.reader;

Python::with_gil(|_| reader.next().map(|v| v.unwrap()))
}
}

#[pyfunction]
#[allow(clippy::too_many_arguments)]
fn write_to_deltalake(
Expand All @@ -1419,7 +1405,7 @@ fn write_to_deltalake(
custom_metadata: Option<HashMap<String, String>>,
) -> PyResult<()> {
py.allow_threads(|| {
let batches = GilIterator { reader: data.0 }; // The pyarrow reader can be backed by a python object
let batches = data.0.map(|batch| batch.unwrap());
let save_mode = mode.parse().map_err(PythonError::from)?;

let options = storage_options.clone().unwrap_or_default();
Expand Down

0 comments on commit 98bf7ec

Please sign in to comment.