Skip to content

Commit

Permalink
Debug statements
Browse files Browse the repository at this point in the history
  • Loading branch information
stinodego committed Oct 21, 2024
1 parent c2e26c5 commit 290675c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions crates/polars-python/src/cloud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@ pub fn prepare_cloud_plan(lf: PyLazyFrame, py: Python) -> PyResult<PyObject> {
/// must exactly match the one expected by the `cudf_polars` package.
#[pyfunction]
pub fn _update_ir_plan_for_gpu(ir_plan_ser: Vec<u8>, py: Python) -> PyResult<PyObject> {
eprintln!("Update function called");

// Deserialize into IRPlan.
let reader = Cursor::new(ir_plan_ser);
let mut ir_plan = ciborium::from_reader::<IRPlan, _>(reader)
.map_err(to_compute_err)
.map_err(PyPolarsErr::from)?;

eprintln!("Deserialized");

// Edit for use with GPU engine.
gpu_post_opt(
py,
Expand All @@ -40,12 +44,16 @@ pub fn _update_ir_plan_for_gpu(ir_plan_ser: Vec<u8>, py: Python) -> PyResult<PyO
)
.map_err(PyPolarsErr::from)?;

eprintln!("Updated");

// Serialize the result.
let mut writer = Vec::new();
ciborium::into_writer(&ir_plan, &mut writer)
.map_err(to_compute_err)
.map_err(PyPolarsErr::from)?;

eprintln!("Re-serialized");

Ok(PyBytes::new_bound(py, &writer).to_object(py))
}

Expand Down

0 comments on commit 290675c

Please sign in to comment.