helix_ir.diff¶
helix_ir.diff — schema diffing and change classification.
- helix_ir.diff.diff(old: Schema, new: Schema) SchemaDiff[source]¶
Compare two schemas and return a SchemaDiff.
Classification rules: - Field removed: BREAKING (downstream consumers break) - Field added (nullable): SAFE - Field added (non-nullable): RISKY (existing data won’t have this field) - Type narrowed (e.g. string → int): BREAKING - Type widened (e.g. int32 → int64): SAFE - Type changed incompatibly: BREAKING - Nullable → non-nullable: RISKY - Non-nullable → nullable: SAFE - Semantic changed: RISKY - PII class added: RISKY - PII class removed: SAFE (becoming less sensitive)
- class helix_ir.diff.SchemaDiff(old_name: str, new_name: str, changes: tuple[SchemaChange, ...])[source]¶
Bases:
objectResult of comparing two schemas.
- changes: tuple[SchemaChange, ...]¶
- filter(severity: str) SchemaDiff[source]¶
Return a new SchemaDiff containing only changes of the given severity.
- filter_kind(kind: str) SchemaDiff[source]¶
Return a new SchemaDiff containing only changes of the given kind.