Skip to content

Commit

Permalink
feat(python): Release the GIL in collect_schema
Browse files Browse the repository at this point in the history
  • Loading branch information
ritchie46 committed Jul 21, 2024
1 parent e8e68a1 commit 0001a3f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion py-polars/src/lazyframe/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,9 @@ impl PyLazyFrame {
}

fn collect_schema(&mut self, py: Python) -> PyResult<PyObject> {
let schema = self.ldf.schema().map_err(PyPolarsErr::from)?;
let schema = py
.allow_threads(|| self.ldf.schema())
.map_err(PyPolarsErr::from)?;

let schema_dict = PyDict::new_bound(py);
schema.iter_fields().for_each(|fld| {
Expand Down

0 comments on commit 0001a3f

Please sign in to comment.