Skip to content

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

[1.0.0] - 2026-03-29

Added

  • Semantic equality comparison: All expression types now implement __eq__ and __hash__ for structural equality. Comparison is order-insensitive for commutative compound expressions (AllExpr, AnyExpr, In). Enables expressions to be used in sets and as dict keys, and fixes Field.__eq__ so it returns a bool instead of an Eq node when compared to another expression object.

Changed

  • Optimizer — NOT of comparison folded to its complement (runs before De Morgan's law):
  • NOT(f == v)f != v
  • NOT(f != v)f == v
  • NOT(f < v)f >= v
  • NOT(f <= v)f > v
  • NOT(f > v)f <= v
  • NOT(f >= v)f < v
  • NOT(f.is_null())f.is_not_null()
  • NOT(f.is_not_null())f.is_null()

Fixed

  • Optimizer recursion: The optimizer now recurses into sub-expressions created by each rule before moving on.

[0.8.0] - 2026-03-26

Changed

  • Aggregation COUNT field handling: Constructing an Aggregation with AggregationFunction.COUNT and a non-None field no longer raises ValueError. The field is now silently ignored and set to None.

[0.7.0] - 2026-03-25

Added

  • Field pruning and projection (therismos.prune_fields): Remove or project field-based constraints from an expression tree in a polarity-aware manner. See Field Pruning.

[0.6.0] - 2026-03-21

Added

  • Expression Templates: Parameterized, persistable filter expressions with named placeholders and a transform pipeline DSL. See Templates.

  • Between expression: A new first-class expression for half-open range checks (lower <= field < upper). Constructed via Field.between(lower, upper).

[0.5.0] - 2026-02-25

Added

  • Polars backend (therismos[polars]): PolarsExprVisitor, PolarsSortSpecVisitor, PolarsGroupSpecVisitor.
  • Pandas backend (therismos[pandas]): PandasExprVisitor, PandasSortSpecVisitor, PandasGroupSpecVisitor.

[0.4.1] - 2026-01-27

Changed

  • Internal Refactoring: Generic OptimizationRecord[T], shared keep_last_occurrence() utility, Serializer.GRAMMAR class constant. No public API changes.

[0.4.0] - 2026-01-20

Added

  • Expression Class Hierarchy: New abstract base classes: AtomicExpr, CompositeExpr, DecoratorExpr, FieldBasedExpr, SingleValuedFieldExpr, MultiValuedFieldExpr, ComparisonExpr.
  • Multi-Valued Field Evaluation: unwind_data utility and "any"/"none" semantics for list fields.
  • Construction-Time Validation: SingleValuedFieldExpr subclasses raise TypeError for list/tuple/set values.

Changed

  • BREAKING: Serializer parameter renamed field_typesimplicit_field_types.
  • BREAKING: Serializer method renamed register_type()register_custom_type().
  • BREAKING: Expr.evaluate() input must now be wrapped with unwind_data.
  • BREAKING: Expr.evaluate() renamed from the previous Expr.run_eval() — avoids false positives from static analyzers that flag unsafe dynamic evaluation.

[0.3.0] - 2025-11-23

Added

  • Sorting Module: SortOrder, SortCriterion, SortSpec, optimizer, visitors, MongoDB converter, serializer.
  • Grouping and Aggregation Module: AggregationFunction, Aggregation, GroupSpec, optimizer, visitors, MongoDB converter, serializer.

[0.2.0] - 2025-11-23

Added

  • Expression Serialization: Grammar-based Serializer for compact string representations. See Serialization.

[0.1.0] - 2025-11-22

Added

  • Core expression AST with Eq, Ne, Lt, Le, Gt, Ge, Regex, In, IsNull.
  • Compound expressions: AllExpr, AnyExpr, NotExpr.
  • Optimizer with contradiction/tautology detection, De Morgan's law, and more.
  • Visitor pattern with built-in StringVisitor, DictVisitor, CountVisitor, FieldGathererVisitor.
  • MongoDB backend converter (MongoVisitor).