Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-python/src/cloud_client.rs
7884 views
1
use pyo3::prelude::{Python, *};
2
use pyo3::types::PyBytes;
3
4
use crate::PyLazyFrame;
5
use crate::error::PyPolarsErr;
6
7
#[pyfunction]
8
pub 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
}
19
20