What's New in Version 1.25.0
Version 1.25.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”-
You can now tear down a deployed model from Python with
model.teardown(), which is the cleanup counterpart tomodel.deploy(), so you can remove a model you no longer need without leaving your script or notebook.Called with no arguments,
model.teardown()only shows what it would remove and deletes nothing. When you passforce=True, the call actually performs the teardown. This drops the model’s deployed schema in Snowflake, along with its meta schema and operation log, which is the same thing therai models teardownCLI command does:model.teardown() # preview: lists what would be dropped, drops nothingmodel.teardown(force=True) # drop the deployed model for realTeardown cannot be undone, so check the preview before you use
force=True. Your local model files, including the generatedshared_model.py, are left in place. -
Running
rai doctor reportnow shows whichshared_model.pyfile it used, as a new “Shared model file” entry in the report summary. This lets you confirm PyRel picked up the file you expected, which matters when a stray copy in a parent directory could otherwise be used without you noticing.
Bug Fixes
Section titled “Bug Fixes”-
Fixed a bug where a query that placed a
union(...)next to another filter in the samewhere(...)could return incorrect results.For example, the
status == "open"filter below was ignored for one region, so results could include orders that were not open. The filter now applies to both branches of theunion:where(Order.status == "open",union(Order.region == "US", Order.region == "EU"),).select(Order.id).to_df() -
Fixed a bug that could cause an “invalid identifier” error when you deployed a model to Snowflake.
-
Fixed a bug that could crash Snowflake’s SQL compiler with an out-of-memory error when deploying a model.
-
Fixed a bug that caused a Snowflake “invalid regular expression” or “named groups not supported” error when calling
re.sub,re.search, orre.matchon certain patterns, such asre.sub(r"\D", "", text). -
Reading table rows into a concept no longer exposes the internal
__row_id_*fields it uses to tell identical rows apart. They previously appeared as public properties when you inspected your model, and are now kept internal. -
When
rai models deployfails, you now see a short, readable error message instead of a long Python traceback. It also exits with a nonzero exit code, so scripts and CI pipelines can detect the failure and stop instead of continuing as if the deploy worked. This also applies to--wait, which is the option that keeps the command running until the deploy finishes. -
The first deploy of a large model no longer fails with an
OplogAppendTooLargeError, which used to stop the deploy with no way around it when it needed to write more than about 900 KB at once to the model’s operation log. The operation log is the running record of changes PyRel keeps for a deployed model. The deploy now completes with no change to your model. -
A model no longer fails to deploy with an
[Unground Variable]error when a concept is identified by both a reference to another concept and a plain-value field from the same source table, for example aLineItemidentified by itsOrderand a line number. -
Running
rai models pullmore than once on a shared live branch, one that several people deploy to and pull from, now gives consistent results. Before, a second pull could quietly change the model definition you ended up with, so collaborators could drift out of sync. To get the fix, upgrade every collaborator to 1.25.0 before anyone runs the first pull, because afterward an older version of PyRel can no longer write to that branch. -
In the
rai debugger, you can now expand a compiler pass for one block of a deployed model without the same pass opening in every other block, so the view stays focused on the block you are inspecting.