A DataFrame plan can run in your Python process or on a worker in your Chalk environment. Test the transformation on a few rows first. Then submit the same plan to Chalk and use the job handle to retrieve the result.

​
Check the query locally

Install chalkdf and chalkpy. From your project directory, sign in with chalk login and use chalk config to check which environment will receive the job. The local calculation uses three purchases.

from chalk import _
from chalkdf import DataFrame

orders = DataFrame.from_dict({"user": ["a", "a", "b"], "amount": [12, 8, 30]})
totals = orders.agg(["user"], _.amount.sum().alias("spend")).order_by("user")
totals.run()
#
userstring
spendint64
1a20
2b30

​
Submit the plan and retrieve the result

remote_run() submits a serializable plan and returns a job handle. You can continue working while the job runs. Call wait() when you need the rows. Chalk reports the run’s progress and dashboard link while you wait.

job = totals.remote_run(correlation_id="chalkdf-docs-example")
job.wait()
#
userstring
spendint64
1a20
2b30

Both runs produce the same ordered totals. Use job.operation_id to identify this particular run and job.status() to poll it. The correlation ID is a label you supply, for example to associate several runs with one workflow. If a job fails or is canceled, wait() raises DataFrameRunFailedError. Inspect its status, error_message, and dashboard_url to investigate the attempt.

Read the terminal status after retrieving the result.

import pyarrow as pa

pa.table({"status": [job.status()]})
#
statusstring
1COMPLETED

​
Read a completed result again

Save the operation ID if you plan to revisit the result from another session. An authenticated client can request fresh, short-lived download URLs for the completed run’s Parquet files. Scan those files to build a new query over the saved rows.

from chalk.client.client_grpc import ChalkGRPCClient

client = ChalkGRPCClient()
files = client.get_dataframe_run_download_urls(job.operation_id)
saved = DataFrame.scan(files)
saved.filter(_.spend >= 25).select("user", "spend").run()
#
userstring
spendint64
1b30

This query reads the saved totals and filters them locally. The original aggregation ran once on the worker. In a later session, pass the saved operation ID to the client and request new URLs.

​
Inspect a run in the dashboard

Open the dashboard link printed by wait(). In Details, check the status and attempts. Open Static Plan to trace the operations you submitted. In Performance, compare input rows, output rows, and memory by operator. For a grouped query, a large drop between input and output rows tells you where the aggregation reduced the data. Open Results to inspect the output.

​
Choose the input and worker

DecisionHow to configure it
Where the worker reads dataA frame built with from_dict carries its small input in the plan. For larger inputs, point DataFrame.scan at files the worker can read in object storage, or use a configured SQL data source. A laptop-local file path must also be accessible to the worker to run remotely.
Which resources run the jobPass the name of a configured resource group to remote_run(resource_group=...). The worker uses the resources configured for that group.
How much data comes backFilter, aggregate, or project in the plan before calling remote_run(). The example returns one row per user. Calling wait() retrieves the materialized result for the client.
How to follow executionOpen the DataFrame run in the dashboard to inspect attempts and performance. The SDK requests performance summary updates every five seconds by default. Set update_performance_summary_interval_secs to change the interval, or to zero to disable updates.

For recurring feature computation, use the same DataFrame transformations in a static resolver. To call a deployed function on each row in a remote query or resolver, see Catalog calls. For input configuration, see Files and SQL.