Skip to main content
On this page

Kater CLI Present and share chart

kater chart snapshot

Gets the rows that the last run of a query kept, for the same inputs, to draw charts from.

It does not run the query, so run it first with kater run. When no rows are kept, Kater refuses with snapshot_unavailable.

Examples

Terminal window
# Run the spend_by_platform query on the warehouse
kater run --select connections/snowflake_prod_connection/workspaces/ad_reporting/query_contracts/spend_by_platform.sql
# Get the rows that the run kept
kater chart snapshot --request-file spend_by_platform.json

Arguments

ArgumentDescription
<path>Optional. In place of --request-file: the workspace, the query file or the chart file the request names.

Options

OptionDescription
--request-file <file>The query, as JSON, such as spend_by_platform.json. Give - to read it from standard input. See The request.

It also takes the global options --json, --kater-root, --scope and --help.

The request

FieldWhat it holds
sourceThe query: its name, and the full path of its workspace under namespace.
inputsOptional. The parameter values and the filters of the run to read. They must be the same as the run’s.
own_filtersOptional. True reads the run that had the query’s own optional filters on, as kater chart execute with own_filters and a dashboard tile run it.
spend_by_platform.json
{"source": {"name": "spend_by_platform", "namespace": {"path": "connections/snowflake_prod_connection/workspaces/ad_reporting"}}}

What it shows

The answer’s snapshot holds the rows, with an id. kater chart preview takes that id as snapshot_id, to draw a chart from these rows. You need permission to run the query.

See also