What's New in Version 1.26.0
Version 1.26.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 deploy a model from Python with
model.deploy()as a programmatic alternative to the CLI. It relies on the operation log, which is off by default, so setoplog.enabledtotrueto turn it on. -
If you run PyRel inside Snowpark Container Services (SPCS) and connect via OAuth, use the new
hostoption in your Snowflake connection configuration to the container’sSNOWFLAKE_HOSTendpoint. OAuth tokens in your configuration are validated against this host. -
You can now cap how long PyRel waits for a reasoner to become ready or a query to finish by setting
data.poll_timeout_minsin your raiconfig to a number of minutes so it raises a clear timeout error instead of hanging forever. It is off by default and only stops your Python client, not any work already running in Snowflake. -
If your Snowflake account cannot use hybrid tables, such as a Tri-Secret Secure account, you can now set
oplog.table_type: standardin your raiconfig to provision the operation log as a standard table instead of thehybriddefault. Note that changing this setting after your first deployment does not update the existing oplog table. You’ll need to delete the table and re-deploy in order for it to take effect. -
The
product()aggregation function, which multiplies values together, is now supported in deployed models. -
The
rai debuggerhas a new Refresh Log view that shows a deployed model’s install plan and refresh history as a diagram, so you can watch a refresh as it runs. You can also start it with--no-showto skip opening a browser window when you restart it. -
PyRel now catches a conflicting
implicit_propertiessetting when you deploy, branch, merge, or pull with the operation log enabled, raisingModelConfigMismatchErrorwhen your current setting differs from the one recorded at the model’s deploy, instead of letting the conflict break the model later. This setting (part ofModelConfig) controls whether using an undeclared property creates it or raises an error. To resolve the error, match the recorded setting or pass--forceto override and record the new one. -
Improved performance for refreshing a deployed model.
-
Improved generated output table name in deployed models. For example, tables with generated names like
Number_38_0_datapointswill now be saved as simplydatapoints. If downstream queries or dashboards referenced the old name, update them after you redeploy. -
Improved the error message you get when a deploy can’t start because another is already in progress.
Bug Fixes
Section titled “Bug Fixes”-
Fixed a model deployment bug where a model that used
Model.Enum()failed to deploy with the errorValueError: No SQL type for column 'x'. -
Fixed a bug where ranking or limiting rows over a concept with a composite key in a query or definition would fail with an invalid identifier error.
-
PyRel now internally sorts entities with composite keys differently than it used to. You may see results for queries that involve
rank()ortop()return rows where the rank is tied in a slightly different order. -
Fixed a model deployment bug where calling
re.findall()orstrings.split()on aTablecolumn produced extra rows in the output table. -
Fixed a bug where a query computed two
count(...).per(key)values over the same text key, one for values in a list and one for values not in it. The in-list count silently returnedNULLon every row. Both counts now return the correct number. -
Fixed a bug that caused some aggregations over properties that are set for some entities but not others to include values from entities that should have been excluded.
-
Fixed a model deployment issue that caused some models to fail with a
SQL object_name collisionerror when deployed. -
Fixed a bug where an unresolved chained reference in a query (a multi-step property or relationship lookup that was never given a value) could silently produce incorrect query results. PyRel now raises an error.
-
Fixed a bug in the prescriptive reasoner where a count or a summed objective (a total or a tally aggregated over rows) could silently drop rows that shared a value, so the solver optimized the wrong total. For example, with costs of 5, 5, and 7, the two 5s collapsed into one, giving
12*xinstead of17*x. Each row now contributes its own term. -
The prescriptive reasoner now rejects a non-numeric value, such as a text or date property, used where a number is expected, with a clear error when you build the problem. Before, the problem built successfully and failed only during the solve, with a confusing internal error.
-
Fixed several problems with tearing down a deployed model using
rai models teardown. Leftover local state could be wrongly reused on a later redeploy, and a partial teardown could not be completed by re-running it. Teardown now cleans up reliably and can be safely re-run after a partial failure. -
Fixed a bug where
rai models teardownandrai models mergecould act on a malformed schema. Both commands now always reject a malformed or ambiguous schema name with a clear error.