fused run
Run a UDF and print the result to stdout.
fused run CANVAS UDF [OPTIONS] [--<param>=<value> ...]
CANVAS is the canvas collection context. Use "" for standalone local files. UDF is passed to fused.load and accepts:
- A local Python file:
udf.py - A Fused identifier:
user@example.com/my_udformy_udf(resolved againstCANVAS) - A GitHub URL:
https://github.com/org/repo/blob/main/udf.py - Inline source: a string containing at least one newline is treated as Python module text
Options
| Flag | Description |
|---|---|
--engine [remote|local] | Run on Fused servers (remote, default) or locally |
--instance-type TEXT | Remote instance type override |
--cache-max-age TEXT | Max age for cached results, e.g. 10s, 5m, 1h |
--no-cache | Bypass the cache entirely |
--disk-size-gb INTEGER | Remote disk size override |
--max-retry INTEGER | Number of retries on failure |
--verbose / --no-verbose | Show UDF stdout/stderr (on by default) |
--stdin | Read UDF source from stdin instead of UDF argument |
Passing UDF parameters
Any extra --key=value flags are forwarded directly to the UDF as keyword arguments, matching the UDF's function signature:
fused run "" udf.py --bbox="-122.5,37.5,-122.0,38.0" --zoom=12
Examples
# Run a local UDF
fused run "" udf.py
# Run locally (no network call)
fused run "" udf.py --engine local
# Pass parameters to the UDF
fused run "" udf.py --city="San Francisco" --limit=100
# Run a UDF from a Fused canvas
fused run my_canvas my_udf
# Run from a GitHub URL
fused run "" https://github.com/fusedio/udfs/blob/main/public/DuckDB_H3_Example/DuckDB_H3_Example.py
# Pipe UDF source from stdin
cat udf.py | fused run "" --stdin
# Skip cache
fused run "" udf.py --no-cache
tip
Run fused udf-schema "" udf.py first to see the UDF's parameter names and types before passing --key=value arguments.