SQLGroupBy  type: sql_group_by#

class lumen.transforms.sql.SQLGroupBy(*, aggregates, by, controls, name)#

Performs a Group-By and aggregation


Parameters#

aggregates

type: dict
default: None
mapping of Aggregate Functions to use to which column to use them on

by

type: list[Any]
default: []
Columns to Group by


Methods#

SQLGroupBy.apply(sql_in)#

Given an SQL statement, manipulate it, and return a new SQL statement.

Parameters:

sql_in (string) – The initial SQL query to be manipulated.

Returns:

New SQL query derived from the above query.

Return type:

string

SQLGroupBy.to_spec(context: Dict[str, Any] | None = None) Dict[str, Any]#

Exports the full specification to reconstruct this component.

Return type:

Resolved and instantiated Component object