Skip to content

PyGWalker Computation Modes

Use computation to choose where PyGWalker runs data queries. kernel_computation, cloud_computation, and use_kernel_calc are legacy compatibility flags and are scheduled for removal in PyGWalker 0.7.0.

import pygwalker as pyg
 
walker = pyg.walk(df, spec_path="./gw_config.json", computation="kernel")

Mode matrix

computation valueInternal behaviorUse when
omittedPreserve automatic behaviorYou want PyGWalker to keep its default selection.
"auto"Preserve automatic behaviorYou want to be explicit without forcing a backend.
"browser"Frontend/browser computationYou need static HTML or have smaller local data.
"kernel"Local DuckDB-backed Python computationYou need larger local data in a live notebook, Streamlit, Gradio, or webserver session.
"cloud"Kanaries cloud computationYou want cloud-backed computation with a Kanaries API key.

Recommended examples

For static or frontend-only output, choose browser computation.

html = pyg.to_html(df, spec_path="./gw_config.json", computation="browser")

For a live notebook or app session with larger local data, choose kernel computation.

walker = pyg.walk(df, spec_path="./gw_config.json", computation="kernel")

For cloud computation, choose cloud mode and pass your API key.

walker = pyg.walk(
    df,
    spec_path="./gw_config.json",
    computation="cloud",
    kanaries_api_key="...",
)

Legacy flags

Legacy optionReplacementStatus
kernel_computation=Truecomputation="kernel"Deprecated, scheduled for removal in PyGWalker 0.7.0.
kernel_computation=Falsecomputation="browser"Deprecated, scheduled for removal in PyGWalker 0.7.0.
cloud_computation=Truecomputation="cloud"Deprecated, scheduled for removal in PyGWalker 0.7.0.
use_kernel_calc=Truecomputation="kernel"Deprecated, scheduled for removal in PyGWalker 0.7.0.
use_kernel_calc=Falsecomputation="browser"Deprecated, scheduled for removal in PyGWalker 0.7.0.

Legacy flags still work for compatibility and emit deprecation warnings. New docs and new code should use computation.

Conflict rule

Do not mix a non-auto computation value with enabled legacy flags.

# Raises ValueError.
pyg.walk(df, computation="browser", kernel_computation=True)

Use one expression of intent instead:

pyg.walk(df, computation="browser")

Static HTML limitations

Static HTML exports cannot call back into a live Python kernel or cloud service. The following are rejected:

pyg.to_html(df, computation="kernel")
pyg.to_html(df, computation="cloud")
pyg.to_html(df, kernel_computation=True)
pyg.to_html(df, cloud_computation=True)
pyg.to_html(df, use_kernel_calc=True)

Use browser computation for static exports:

html = pyg.to_html(df, spec_path="./gw_config.json", computation="browser")

Use Notebook APIs, Streamlit, Gradio, or a webserver session when you need live kernel or cloud computation.

Adapter notes

AdapterComputation notes
pyg.walk, pyg.render, pyg.tableAccept computation; route to notebook adapters in Jupyter and webserver adapters elsewhere.
pyg.WalkerStores computation mode for reuse. Static export methods still reject live kernel/cloud modes.
pygwalker.api.anywidget.walkDefaults to kernel behavior when automatic mode is used in notebook widget contexts.
StreamlitRendererDefaults to kernel behavior when automatic mode is used; accepts computation="browser", "kernel", or "cloud".
get_html_on_gradioAccepts computation and live backend modes.
pyg.to_htmlBrowser/static only.
Reflex adapterRejects kernel and cloud computation; use computation="browser".

Related Guides