Skip to content

Commit

Permalink
Pass options as a python dict
Browse files Browse the repository at this point in the history
  • Loading branch information
mroeschke committed Feb 6, 2025
1 parent 54731fc commit 276d5ed
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/polars-python/src/lazyframe/general.rs
Original file line number Diff line number Diff line change
Expand Up @@ -830,19 +830,19 @@ impl PyLazyFrame {
std::mem::take(expr_arena),
);

let io_kwargs = PyDict::new(py);
let _ = io_kwargs.set_item("to", "csv");
let _ = io_kwargs.set_item("options", Wrap(options.clone()));
let _ =
io_kwargs.set_item("cloud_options", cloud_options.clone().map(Wrap));
// Get a copy of the arena's.
let arenas = nt.get_arenas();

// Pass the node visitor which allows the python callback to replace parts of the query plan.
// Remove "cuda" or specify better once we have multiple post-opt callbacks.
lambda
.call1(
py,
(nt, Wrap(options.clone()), cloud_options.clone().map(Wrap)),
)
.map_err(
|e| polars_err!(ComputeError: "'cuda' conversion failed: {}", e),
)?;
lambda.call1(py, (nt, io_kwargs)).map_err(
|e| polars_err!(ComputeError: "'cuda' conversion failed: {}", e),
)?;
// Unpack the arena's.
// At this point the `nt` is useless.

Expand Down

0 comments on commit 276d5ed

Please sign in to comment.