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(
9    lf: PyLazyFrame,
10    allow_local_scans: bool,
11    py: Python<'_>,
12) -> PyResult<Bound<'_, PyBytes>> {
13    let plan = lf.ldf.into_inner().logical_plan;
14    let bytes =
15        polars::prelude::prepare_cloud_plan(plan, allow_local_scans).map_err(PyPolarsErr::from)?;
16
17    Ok(PyBytes::new(py, &bytes))
18}