Skip to content

v0.3.0

Choose a tag to compare

@chaturv3di chaturv3di released this 03 Jun 21:32
· 10 commits to main since this release
da01372

Breaking Changes

  • SegmentSpec.entity_id is now required. Add entity_id: <dim_pk_column> to every segment spec YAML. Specs without it raise SpecValidationError at load time.
  • SegmentSpec.source is now the DIM table URI. Previously parsed but ignored; it is now used to generate a JOIN in the SQL query. Ensure it points to the DIM table, not the fact table.
  • segments in compute() no longer accepts list[str]. The parameter type changed from str | list[str] | None to dict[str, str] | str | None. Only one segment per compute() call is supported; call compute() 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 at compute() 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 in values[].where are automatically qualified with _dim. via sqlglot AST rewriting.
  • segments dict formsegments={"customer_value": "buyer_id"} pins the fact-side FK column explicitly, enabling the same segment spec to join via different columns (e.g. buyer_id vs seller_id).
  • referenced_columns for segment specsValidationResult.referenced_columns now includes entity_id, join_keys (when non-empty), and values[i].where keys.
  • __version__ syncedaitaem.__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 segments parameter 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/