Skip to content

innovate.execute

All current Python definitions

View source · Source file SHA-256: 522871fe0b61b840b5f85b8f278beb2b79c7afd68645265ae3a68983d56d74e4

def execute(operation: str, model: str | None=None, **payload: Any) -> dict[str, Any]: ...

Execute a schema-2.0 request and retain the complete native response.

Use this low-level interface for operations that do not have a table wrapper. Payload fields are operation-specific and must obey the native contract; unsupported operations and model features fail rather than falling back. The wrapper adds the schema version and serializes the request. It does not infer time units, convert observations between levels and interval counts, sort arrays, or repair missing values.

  • operation: Native operation name, such as discover_models or predict_model.
  • model: Native model key, such as bass or logistic. Use the default None for operations that do not select a model.
  • payload: JSON-compatible keyword fields placed in the request’s payload object. Use lists for arrays, including singletons, and None for JSON null. All numeric values must be finite; their units and allowed ranges follow the selected native operation.

Decoded response envelope, including result and native metadata. JSON objects become dictionaries, arrays become lists and null becomes None. Successful envelopes may omit error. A non-null outer native error is raised before return; errors stored inside batch or scenario result rows remain available for the caller to inspect.

  • NativeError: If the kernel rejects the request or cannot execute it.
  • TypeError: If a payload value cannot be serialized as JSON.
  • ValueError: If serialization encounters NaN, infinity or a circular object.
import innovate
response = innovate.execute("discover_models")
assert response["schema_version"] == "2.0"
assert response.get("error") is None
assert "bass" in {model["key"] for model in response["result"]["models"]}