GroupedTable

class calista.group.GroupedTable(engine, agg_keys)

Bases: object

analyze(rule_name: str, rule: AggregateCondition) Metrics

Compute Metrics based on a condition.

Args:

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

Returns:

Metrics: The metrics resulting from the analysis.

Raises:

Any exceptions raised by the engine’s execute_condition method.

analyze_rules(rules: Dict[str, AggregateCondition]) List[Metrics]

Compute Metrics based on a condition.

Args:

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

Returns:

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

Raises:

Any exceptions raised by the engine’s execute_condition method.

apply_rule(rule: AggregateCondition) DataFrameType

Returns the dataset with new columns of booleans for given condition.

Args:

rule (AggregateCondition): The aggregate condition to execute.

Returns:

DataFrameType: The aggregated dataset with the new column resulting from the analysis.

apply_rules(rules: Dict[str, AggregateCondition]) DataFrameType

Returns the dataset with new columns of booleans for each rules or the given condition.

Args:

rules (Dict[RuleName, AggregateCondition]): The name of the rules and the aggregate conditions to execute.

Returns:

DataFrameType: The aggregate dataset with new columns resulting from the analysis.

get_invalid_rows(rule: AggregateCondition, granular=False) DataFrameType

Returns the dataset filtered with the rows not validating the rules.

Args:

rule (AggregateCondition): The aggregate condition to evaluate. granular (bool, optional): default False. Whether or not to retrieve the data at the granular level.

Returns:

DataFrameType: The aggregated dataset filtered with the rows where the rule is not satisfied.

get_valid_rows(rule: AggregateCondition, granular=False) DataFrameType

Returns the dataset filtered with the rows validating the rules.

Args:

rule (AggregateCondition): The aggregate condition to evaluate. granular (bool, optional): default False. Whether or not to retrieve the data at the granular level.

Returns:

DataFrameType: The aggregated dataset filtered with the rows where the rule is satisfied.