v0.3.0
Breaking Changes
SegmentSpec.entity_idis now required. Addentity_id: <dim_pk_column>to every segment spec YAML. Specs without it raiseSpecValidationErrorat load time.SegmentSpec.sourceis now the DIM table URI. Previously parsed but ignored; it is now used to generate aJOINin the SQL query. Ensure it points to the DIM table, not the fact table.segmentsincompute()no longer acceptslist[str]. The parameter type changed fromstr | list[str] | Nonetodict[str, str] | str | None. Only one segment percompute()call is supported; callcompute()once per segment.
Added
SegmentSpec.entity_id— required field identifying the primary key column on the DIM table.SegmentSpec.join_keys— optional whitelist of fact-table FK columns accepted as join keys. When non-empty, the key supplied atcompute()time must appear in this list.- DIM-table JOIN in generated SQL — segments now generate
FROM fact t JOIN dim _dim ON t.<join_key> = _dim.<entity_id>. Unqualified column references invalues[].whereare automatically qualified with_dim.via sqlglot AST rewriting. segmentsdict form —segments={"customer_value": "buyer_id"}pins the fact-side FK column explicitly, enabling the same segment spec to join via different columns (e.g.buyer_idvsseller_id).referenced_columnsfor segment specs —ValidationResult.referenced_columnsnow includesentity_id,join_keys(when non-empty), andvalues[i].wherekeys.__version__synced —aitaem.__version__was stale at"0.2.1"; now correctly reflects the installed version.
Documentation
- User guide: rewritten SegmentSpec section with DIM-join model, example YAML, and field table.
- Computing metrics guide: updated
segmentsparameter docs and error table. - API reference: added segment spec keys to
ValidationResult.referenced_columns. - Changelog: this entry.
Full changelog: https://chaturv3di.github.io/aitaem/changelog/