Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/crates/polars-plan/src/client/mod.rs
6939 views
1
mod check;
2
3
use polars_core::error::PolarsResult;
4
5
use crate::dsl::{DslPlan, PlanSerializationContext};
6
7
/// Prepare the given [`DslPlan`] for execution on Polars Cloud.
8
pub fn prepare_cloud_plan(dsl: DslPlan) -> PolarsResult<Vec<u8>> {
9
// Check the plan for cloud eligibility.
10
check::assert_cloud_eligible(&dsl)?;
11
12
// Serialize the plan.
13
let mut writer = Vec::new();
14
dsl.serialize_versioned(
15
&mut writer,
16
PlanSerializationContext {
17
use_cloudpickle: true,
18
},
19
)?;
20
21
Ok(writer)
22
}
23
24