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/reconnect.py
6940 views
1
"""
2
import polars as pl
3
import polars_cloud as pc
4
5
# --8<-- [start:setup]
6
ctx = pc.ComputeContext(workspace="your-workspace", cpus=4, memory=16)
7
8
ctx.start()
9
# --8<-- [end:setup]
10
11
# --8<-- [start:print]
12
print(ctx)
13
# --8<-- [end:print]
14
15
# --8<-- [start:connect_id]
16
ctx = pc.ComputeContext.connect('0198e107-xxxx-xxxx-xxxx-xxxxxxxxxxxx')
17
18
# --8<-- [end:connect_id]
19
20
# --8<-- [start:select]
21
# Interactive interface to select the compute cluster you want to (re)connect to
22
ctx = pc.ComputeContext.select()
23
# --8<-- [end:select]
24
25
# --8<-- [start:via_workspace]
26
# List all clusters in the specified workspace
27
pc.ComputeContext.list('your-workspace-name')
28
# --8<-- [end:via_workspace]
29
"""
30
31