Skip to content

PlatformAnalyse

Functions

The calculation SQL can't say, written in Python

A function is Python code from your project, run by the nodes of your flows on a fixed, isolated runtime. It takes tables, returns a table, and runs the same in the cloud and on the node.

Function · z_deviationv3
def transform(inputs, params, ctx):
    rows = inputs["rows"].copy()
    col = params["column"]
    rows["z"] = (rows[col] - rows[col].mean()) / rows[col].std()
    return {"rows": rows}

Input rows · table

Output rows · table

pandas · scikit-learn · no network

Illustrative example

Python where you need it, on the same data

  • A fixed, known runtime

    numpy, pandas, pyarrow, scipy, scikit-learn, onnxruntime and joblib. No network and no installs, so the result is the same wherever it runs.

  • Tables in, table out

    Inputs arrive as pandas DataFrames and the function returns its rows. The contract declares columns and parameters, and the flow checks it.

  • Try it on a sample

    From the Try tab, run the saved version on a sample of data before it reaches a flow.

  • Versions and approval

    Every save is a version. Project code in a flow needs an administrator's approval.

How you write a function

  1. 01

    Write the code

    In the Lab you write the function in the Code tab. Athena, a separate AI module, can draft the code.

  2. 02

    Declare the contract

    You say which tables go in and which columns come out, plus the parameters. The parameters become the node's form in the flow.

  3. 03

    Put it in a flow

    The function becomes a node of a flow, which runs it on a schedule or on new data.

In detail

Language
Python.
Libraries
numpy, pandas, pyarrow, scipy, scikit-learn, onnxruntime, joblib.
Isolation
No network and no package installs.
Where it runs
The same in cloud flows and on the node, on amd64 and arm64.
Inputs and outputs
Tables as pandas DataFrames; you return a table.
It can
Compute indices and deviations, or fit a scikit-learn model on the data it receives.

Frequently asked questions

No. The runtime is fixed: the libraries are the ones listed and packages cannot be installed. That is what makes execution identical in the cloud and on the node.

Bring us a question you can't answer today.

We start from a real question your business has and walk the path from source to dashboard with your systems, not a demo dataset.