aeat.domain.calculations.registry._relation_aggregation module

Single accessor for a registry relation’s aggregation operator.

The relation aggregation.op was re-parsed inline as str((relation.aggregation or {}).get("op", "copy")) at the requirement-keying, resolve, and M390-partition sites — exactly the untyped re-parse the binding-aggregation-is-typed rule forbids for bindings, on the relation half it skipped. RelationDefinition.aggregation is now the typed RelationAggregation model (an unknown op is rejected at registry-build by its strict op field). This module centralises the read into one relation_aggregation_op() accessor returning the typed RelationAggregationOp, applying the per-relation default in one place.

The relation op axis is deliberately separate from the binding op axis (domain.calculations.registry.binding_aggregation_op()): relations carry only copy / sum, never the binding-only rows / count_distinct / prior_pagos_fraccionados.

See also

domain.calculations.registry._relations

Requirement and resolve paths that call this accessor.

domain.calculations.registry._observation_fold

Shared copy / sum arithmetic applied after this accessor selects the relation op.

core.aggregation

Core enum/model definitions for relation and binding aggregation axes.

relation_aggregation_op(relation)[source]

Return the typed RelationAggregationOp a relation declares.

Reads the RelationDefinition aggregation field. Defaults to COPY when aggregation is absent, preserving the conformant single-period carry default used by relation source requirements.

Return type:

RelationAggregationOp

Parameters:

relation (RelationDefinition)