Transform query results with inline Python
Table-in, table-out — composes downstream of SELECTs.
THEN PYTHON {{ code }}THEN PYTHON({{ code }})| name | type | description |
|---|---|---|
| code | VARCHAR | — |
| _table | TABLE | — |
Executes inline Python transforms against the pipeline dataframe
SELECT
*
FROM
(
VALUES
(1),
(2)
) AS t (x) THEN PYTHON ('df["double"] = df["x"] * 2; result = df') THEN PYTHON (
'result = pd.DataFrame({"double_first":[int(df.iloc[0]["double"])]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Add LLM-computed columns to query results
Filter query results using LLM-based semantic matching
Group by column and aggregate another
Transform query results with inline Python
Table-in, table-out — composes downstream of SELECTs.
THEN PYTHON {{ code }}THEN PYTHON({{ code }})| name | type | description |
|---|---|---|
| code | VARCHAR | — |
| _table | TABLE | — |
Executes inline Python transforms against the pipeline dataframe
SELECT
*
FROM
(
VALUES
(1),
(2)
) AS t (x) THEN PYTHON ('df["double"] = df["x"] * 2; result = df') THEN PYTHON (
'result = pd.DataFrame({"double_first":[int(df.iloc[0]["double"])]})'
)Apply theme styling to a chart specification
Analyze query results with LLM based on a prompt
Remove duplicate rows
Add LLM-computed columns to query results
Filter query results using LLM-based semantic matching
Group by column and aggregate another