What's New in Version 1.29.0
Version 1.29.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”-
Queries that use
path()to find paths in a graph now compile and run faster, especially patterns that repeat a step a bounded number of times with.repeat(min, max). In one benchmark, compiling a large repeated pattern dropped from over a minute to under a second, with no change to results. -
Display strings for constraints and objectives now work when the model runs in Snowflake: the prescriptive reasoner renders them inside the model instead of in the Python client. The rendered text is available as a
display_stringproperty. Callinstall_display_strings()on aProblembefore you deploy it (interactive use installs it automatically on the firstdisplay()). -
Deploying a model that schedules automatic refreshes with
rai models deploynow warns you when the Snowflake role that owns the refresh tasks lacks the account-levelEXECUTE TASKprivilege. Before, the deploy reported success but the refresh never ran, so the tables stayed empty with no explanation. The warning names the role and the exact grant needed to fix it.
Bug Fixes
Section titled “Bug Fixes”-
In a deployed model, several aggregate queries that used to fail with the message
Unsupported subquery type cannot be evaluatedor return wrong results now work correctly. This includes grouped aggregates (.per()), aggregates capped withaggregates.limit, and aggregates used inside anot_()check. -
In a deployed model,
rank()now groups rows correctly when the same definition also contains an unrelated aggregate that uses a fallback value. Before, every row could land in its own group, so the rank was1for every row. This produced silently wrong results with no error. -
After you deploy with op log recording turned off,
rai models listand the relatedbranch,switch, andteardowncommands now work as expected. -
rai models deploy --waitnow makes a new model version visible to other users of the model as soon as its Snowflake objects are installed, rather than after the first data refresh finishes. -
Deploying a model no longer fails when a concept has multiple identifying properties and one of them has no values. That property now deploys as an empty table.
-
When you set
deployment.outputs.reasoneron a model that also defines a prescriptiveProblem, the deploy no longer skips outputting the problem. It keeps the solver’s outputs in place, routes only the outputs it can, and warns about the ones it left alone. -
Querying a model in a Snowflake notebook no longer shows stray error cards (such as
[Invalid iteration] Cannot iterate over Chain objects.) underneath a query that actually succeeded. These came from the notebook inspecting PyRel objects left in the namespace. Real errors from your own code still appear. -
Calling
AnyEntity.ref()no longer raises anUnresolvedTypeerror and now works as expected. -
Deploying a model whose objects are Snowflake dynamic tables and that also uses the logic reasoner no longer shows warnings about dynamic tables or rebuilds them as regular tables.
Deprecations and Removals
Section titled “Deprecations and Removals”-
Problem.display()no longer acceptspart=orwhere=. Passing either now raises aTypeError. To filter what you see, first render the display text withinstall_display_strings(), then read the newdisplay_stringproperty from the constraint (or other expression) you want, just like any other field:problem.install_display_strings()# capacity_constraint is a constraint you defined when building the problemmodel.select(capacity_constraint.name, capacity_constraint.display_string).where(capacity_constraint.name == "cap_3")Output is now sorted as plain text instead of natural number order, so
x_1, x_2, x_10now appears asx_1, x_10, x_2. -
all_differentnow takes a single argument.