helix_ir.types¶
helix_ir.types — type system for Helix IR.
- class helix_ir.types.HelixType(arrow_type: DataType, null_ratio: float = 0.0, cardinality_estimate: int | None = None, sample_count: int = 0, confidence: float = 1.0, semantic: str | None = None, pii_class: str | None = None, source_path: str | None = None, min_value: Any = None, max_value: Any = None, description: str | None = None, tags: frozenset[str] = <factory>)[source]¶
Bases:
objectImmutable type descriptor for a single field in a Helix schema.
Carries both the Arrow physical type and rich metadata such as null ratio, cardinality estimate, semantic tag, and PII class.
- arrow_type: DataType¶
- helix_ir.types.join(a: HelixType, b: HelixType) HelixType[source]¶
Least upper bound. The narrowest type that subsumes both a and b.
- helix_ir.types.meet(a: HelixType, b: HelixType) HelixType[source]¶
Greatest lower bound — the widest type that fits within both a and b.
- helix_ir.types.subsumes(a: HelixType, b: HelixType) bool[source]¶
Return True if any value of type b can be stored in a column of type a.
In lattice terms: a subsumes b iff join(a, b) == a.