polars_python/cloud_client.rs
1use pyo3::prelude::{Python, *};
2use pyo3::types::PyBytes;
3
4use crate::PyLazyFrame;
5use crate::error::PyPolarsErr;
6
7#[pyfunction]
8pub fn prepare_cloud_plan(lf: PyLazyFrame, py: Python<'_>) -> PyResult<Bound<'_, PyBytes>> {
9 let plan = lf.ldf.logical_plan;
10 let bytes = polars::prelude::prepare_cloud_plan(plan).map_err(PyPolarsErr::from)?;
11
12 Ok(PyBytes::new(py, &bytes))
13}