Python package and CLI 1.32.0
If you use prescriptive reasoning (Public Preview, by request), review optimization problems after upgrading because some formerly accepted constraints and objectives now error or change meaning.
How to install this version
Review the changes below before installing. To install this version, activate a compatible Python virtual environment and run:
python -m pip install "relationalai==1.32.0"For the latest installation instructions, see Start building with PyRel.
Breaking Changes
Section titled “Breaking Changes”- Prescriptive reasoning (Public Preview, by request): When you create an optimization problem in your Python code, some constraints and objectives that used to be accepted now raise a clear error or change meaning. Review your existing problems after you upgrade. For example, applying
countdirectly to a decision variable is now rejected because it counts rows rather than the values the solver chooses. A few others still build but now describe a different problem. To check them, print the problem withProblem.display()and confirm the formalized constraints and objectives match what you intended.
New Features and Enhancements
Section titled “New Features and Enhancements”-
You can now use the
percentileandmedianaggregates to summarize your data. You can group either one withper()like any other aggregate. -
Snowflake object tags: When you deploy a model to Snowflake, you can now apply your own existing Snowflake object tags to every object the deploy creates by listing them under
deployment.tags. On a redeploy, each object keeps only the tags you list.deployment:tags:GOVERNANCE.TAGS.COST_CENTER: engineering -
Row-access policies: You can now attach an existing Snowflake row-access policy to the tables, views, and dynamic tables a deploy creates by adding a per-output
policiesoverride underdeployment.outputs. RelationalAI does not fully check the policy first, so an invalid one can still fail when the deploy runs.deployment:outputs:overrides:- objects: [ORDERS]policies:row_access_policy:fqn: GOVERNANCE.POLICIES.TENANT_ACCESScolumns: [TENANT_ID] -
Existing ownership tag: You can now point RelationalAI at a Snowflake tag you already created for object ownership with
deployment.managed_tag. A governed account can then deploy a model without the SnowflakeCREATE TAGprivilege. The deploying role needsAPPLYon the tag andUSAGEon the database and schema that hold it.deployment:managed_tag: GOVERNANCE.TAGS.RELATIONALAI_MANAGED -
You can now open a
rai doctorreport in therai debuggeroffline, without access to the Snowflake account it came from. The trace, Refresh Log, and deployment graphs all work from the unzipped report.
Bug Fixes
Section titled “Bug Fixes”-
A model with a wide concept, roughly 43 or more nullable properties, that failed to deploy with a
RecursionErrornow deploys again. This fixes a regression introduced after version 1.29.1. -
Fixed an issue that caused some models to fail to deploy with an “object already exists” error.
-
Custom metadata schema: If you place a model’s metadata and operation log in a custom schema with
deployment.meta_schema, RelationalAI now uses that location consistently for deploys, teardown, and branch operations. Changing the setting later does not move existing metadata, so set it before your first deploy. -
Redeployed objects: Redeploying a model now recreates every changed Snowflake object consistently, and it preserves the grants you added to its procedures and functions. Because objects are recreated rather than altered, you may need to restore other object-level state yourself.
-
Deploying a model to Snowflake is faster, because RelationalAI now runs its two metadata setup phases in parallel.
-
Conflicting deployment records: Two deployment records that claim the same model identity no longer break
rai modelslisting or teardown for the whole database. The conflicted model stays listed with a warning that explains how to repair it. -
For models deployed to Snowflake, the
varianceandvariance_sampaggregates no longer lose precision on whole-number input. Expressions that raise a value to a power with**, such asmath.haversine, no longer fail. This does not fixgeometric_meanover negative input on Snowflake, which is still unsupported. -
For models deployed to Snowflake, comparing two entity types with
==no longer errors when their identities are stored differently, for example a generated hash versus an integeridentify_bykey. Because the two kinds of identity can never be equal, the comparison now returnsFalse. -
A
where()filter whose condition is a Python builtin call with a literal argument, such asabs(-1) == 2, now filters when the condition is false, as expected. -
For models deployed to Snowflake, queries that compute several aggregate measures over the same grouping now run in a single pass instead of re-scanning the data once per measure. The results are unchanged.
-
Calling
inspect()orto_df()on adefineorrequirefragment now raises a clear error, “Cannot inspect a define” instead of crashing. Adefineorrequireadds to your model rather than running as a query, so there is nothing to inspect. -
Configuration load errors: When a configuration file that RelationalAI discovers automatically, such as
~/.rai, the Snowflake CLI config, or a dbt config, fails to load, RelationalAI now reports the real error and names the file that failed, instead of a generic “no configuration found” message. A commented-out{{ env_var(...) }}line is also no longer evaluated, so it can no longer fail on an unset variable.