What's New in Version 1.21.0
Version 1.21.0 of the relationalai Python package is now available!
To upgrade, activate your virtual environment and run the following command:
pip install --upgrade relationalaiNew Features and Enhancements
Section titled “New Features and Enhancements”-
Improved the clarity of error messages when you define membership between concept types that do not match in
Model.define(). Before this release,m.define(Target(Source))could fail with a generic type-mismatch message that did not tell you how to fix the model. Now the error explains compatible fixes, such as makingTargeta subtype ofSourceor usingAnyEntitywhen you intentionally allow heterogeneous membership. This example shows one invalid definition and two valid fixes:from relationalai.semantics import AnyEntity, Modelm = Model("Demo")SourceConcept = m.Concept("Order")# Invalid: TargetConcept does not extend SourceConcept.TargetConcept = m.Concept("NeedsReview")m.define(TargetConcept(SourceConcept))# Valid fix 1: make the target concept a subtype of SourceConcept.TargetSubtype = m.Concept("OrderThatNeedsReview", extends=[SourceConcept])m.define(TargetSubtype(SourceConcept))# Valid fix 2: use AnyEntity when membership should accept mixed concept types.TargetAnyEntity = m.Concept("NeedsReviewAny", extends=[AnyEntity])m.define(TargetAnyEntity(SourceConcept))
Bug Fixes
Section titled “Bug Fixes”-
Restored arguments passed to
Concept.annotate()when you generate PyRel code and load it again. Before this release, when you generated PyRel code and loaded it again, values insideannotate(...)could be dropped, for example turningannotate(Tag("customer"))intoannotate(Tag). Now fullannotate(...)calls, including their argument values, are preserved when you generate PyRel code and load it again. -
Preserved decimal literal scale and precision when you generate PyRel code and load it again. Before this release, decimals such as
2.50could come back as2.5, and high-precision values could lose digits. Now PyRel preserves decimal meaning during code generation and reload. -
Retained filters in
where(...).require(...)rules when you generate PyRel code and load it again. Before this release, a filtered rule could be regenerated as a broaderModel.require()call without the originalModel.where()condition. Now thewhere(...)condition is preserved, so the requirement still applies only to the intended subset.