CalistaTable

class calista.table.CalistaTable(engine: LazyEngine)

Bases: object

analyze(rule_name: str, condition: Condition) Metrics

Compute Metrics based on a condition.

Args:

rule_name (str): The name of the rule. condition (Condition): The condition to evaluate.

Returns:

Metrics: The metrics resulting from the analysis.

Raises:

Any exceptions raised by the analyze_rules method.

analyze_rules(rules: dict[str, Condition]) list[Metrics]

Compute list[Metrics] based on conditions.

Args:

rules (dict[RuleName, Condition]): The name of the rules and the conditions to execute.

Returns:

list[Metrics]: The metrics resulting from the analysis.

Raises:

Any exceptions raised by the engine’s execute_conditions method.

filter(condition: Condition) CalistaTable
group_by(*cols: str) GroupedTable

Groups the CalistaTable using the specified columns, so we can execute aggregation conditions on them. See GroupedTable for all the available functions after calling group_by.

Args:

cols (list, str):columns to group by. Each element should be a column name (string).

property schema: dict[str, str]

Returns the schema of the underlying dataset.

Returns:

Dict[ColumnName, PythonType]: Dict representing the schema of the underlying dataset.

show(n: int = 10) None

Prints the first n rows to the console.

Args:

n (int, optional): Number of rows to show

where(condition: Condition) CalistaTable

Filters rows using the given condition.

filter() is an alias for where().

Args:

condition : Condition

Returns:

CalistaTable: Filtered CalistaTable.