Skip to content

Commit

Permalink
Add multithreaded_io kwarg
Browse files Browse the repository at this point in the history
  • Loading branch information
Jay Chia committed Oct 2, 2023
1 parent fc3bb35 commit 57b8255
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/daft-io/src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,17 @@ mod py {
fn io_glob(
py: Python,
path: String,
multithreaded_io: Option<bool>,
io_config: Option<common_io_config::python::IOConfig>,
) -> PyResult<&PyList> {
let multithreaded_io = multithreaded_io.unwrap_or(true);
let lsr: DaftResult<Vec<_>> = py.allow_threads(|| {
let io_client = get_io_client(true, io_config.unwrap_or_default().config.into())?;
let io_client = get_io_client(
multithreaded_io,
io_config.unwrap_or_default().config.into(),
)?;
let (scheme, path) = parse_url(&path)?;
let runtime_handle = get_runtime(true)?;
let runtime_handle = get_runtime(multithreaded_io)?;
let _rt_guard = runtime_handle.enter();

runtime_handle.block_on(async move {
Expand Down

0 comments on commit 57b8255

Please sign in to comment.