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 value | Internal behavior | Use when |
|---|---|---|
| omitted | Preserve automatic behavior | You want PyGWalker to keep its default selection. |
"auto" | Preserve automatic behavior | You want to be explicit without forcing a backend. |
"browser" | Frontend/browser computation | You need static HTML or have smaller local data. |
"kernel" | Local DuckDB-backed Python computation | You need larger local data in a live notebook, Streamlit, Gradio, or webserver session. |
"cloud" | Kanaries cloud computation | You 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 option | Replacement | Status |
|---|---|---|
kernel_computation=True | computation="kernel" | Deprecated, scheduled for removal in PyGWalker 0.7.0. |
kernel_computation=False | computation="browser" | Deprecated, scheduled for removal in PyGWalker 0.7.0. |
cloud_computation=True | computation="cloud" | Deprecated, scheduled for removal in PyGWalker 0.7.0. |
use_kernel_calc=True | computation="kernel" | Deprecated, scheduled for removal in PyGWalker 0.7.0. |
use_kernel_calc=False | computation="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
| Adapter | Computation notes |
|---|---|
pyg.walk, pyg.render, pyg.table | Accept computation; route to notebook adapters in Jupyter and webserver adapters elsewhere. |
pyg.Walker | Stores computation mode for reuse. Static export methods still reject live kernel/cloud modes. |
pygwalker.api.anywidget.walk | Defaults to kernel behavior when automatic mode is used in notebook widget contexts. |
StreamlitRenderer | Defaults to kernel behavior when automatic mode is used; accepts computation="browser", "kernel", or "cloud". |
get_html_on_gradio | Accepts computation and live backend modes. |
pyg.to_html | Browser/static only. |
| Reflex adapter | Rejects kernel and cloud computation; use computation="browser". |