Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
pola-rs
GitHub Repository: pola-rs/polars
Path: blob/main/docs/source/src/python/polars-cloud/compute-context.py
6940 views
1
"""
2
import polars_cloud as pc
3
4
# --8<-- [start:compute]
5
ctx = pc.ComputeContext(
6
workspace="your-workspace",
7
instance_type="t2.micro",
8
cluster_size=2,
9
labels=["docs"],
10
)
11
# --8<-- [end:compute]
12
13
# --8<-- [start:default-compute]
14
ctx = pc.ComputeContext(workspace="your-workspace")
15
# --8<-- [end:default-compute]
16
17
# --8<-- [start:defined-compute]
18
ctx = pc.ComputeContext(
19
workspace="your-workspace",
20
memory=8,
21
cpus=2,
22
)
23
# --8<-- [end:defined-compute]
24
25
# --8<-- [start:set-compute]
26
ctx = pc.ComputeContext(
27
workspace="your-workspace",
28
instance_type="t2.micro",
29
cluster_size=2
30
)
31
# --8<-- [end:set-compute]
32
"""
33
34