Skip to content

Union

relationalai.semantics.frontend.base
Union(model: Model, *items: Value)

Represents a logical OR / union across multiple branches.

Union is the object created by Model.union. Unlike Match (created by the | operator), a union combines the results from all branches rather than picking the first branch that can succeed.

Nested unions are flattened, so m.union(m.union(a, b), c) is equivalent to m.union(a, b, c).

  • model

    (Model) - The model this union belongs to.
  • *items

    (Value, default: ()) - Branches to combine. Each branch must return the same number of values.

Most users should not instantiate this class directly. Prefer Model.union (or the convenience function union).

UnionMatchDerivedTableVariableDSLBase
 semantics
├──  frontend > base
│   └──  Model
│       └──  union
└──  union