Skip to content

Python package and CLI 2.0.1

Redeploy to restore deleted Snowflake objects.

How to install this version

Review the changes below before installing. To install this version, activate a compatible Python virtual environment and run:

Terminal window
python -m pip install "relationalai==2.0.1"

For the latest installation instructions, see Install and run PyRel.

  • Model Deployment now supports full redeployment with rai models deploy --redeploy-all. The command recreates all managed tables, views, and dynamic tables, even when their model definitions have not changed. This lets you restore objects deleted directly in Snowflake. Redeployment may rebuild materialized data and use Snowflake resources.

  • Model deployment schedules can now use a selected Snowflake warehouse for their refresh task and managed dynamic tables. Set deployment.schedules.<name>.refresh_warehouse to choose an existing warehouse. If unset, the schedule uses the warehouse used to deploy the model. This setting does not create a warehouse.

  • Deployment reports now show separate counts for your model’s outputs (tables, views, and dynamic tables) and the internal objects PyRel uses to manage deployment, plus the total. If your scripts read the JSON report, update them to use summary.public, summary.internal, and summary.total instead of the former combined count.

  • PyRel deployment plans now print as readable Markdown with Model.plan_deployment().

  • Fixed an issue that caused loading a PyRel model file that uses define() or select() to raise an “Ambiguous model” error when another model was already active in the Python session.

  • Fixed an issue that caused PyRel’s sum(), min(), and max() queries to truncate results when the aggregate result type was wider than its inputs.

  • Fixed an issue that caused recursive PyRel rules using min() or max() to keep rows those aggregates had replaced.

  • Fixed an issue that caused a performance regression in a PyRel query using split_part() at a fixed index inside an aggregate that joins a table to itself.

  • Fixed an issue that caused model deployment refreshes for deployed PyRel models with several metrics and separate filters to combine rows across metrics. Refreshes now keep each metric’s rows separate.

  • Fixed an issue that caused model deployment to mishandle Snowflake schema and object names that require quoting, such as names with spaces or reserved words, during deployment, refresh, redeployment, permission checks, and teardown.

  • Fixed an issue that caused the PyRel debugger’s refresh view to miss the refresh plan and log for configured model names with prefixes or suffixes, including when the Snowflake schema used to track the deployment has a name that must be quoted.

  • Fixed an issue that caused PyRel’s status check for a refreshed Snowflake dynamic table to fail when its timestamp used a custom format with fractional seconds and a time-zone offset.

  • Fixed an issue that caused PyRel’s default query mode to print an ignored cleanup exception at exit when model deployment was the first operation to open the Snowflake session and model.keep was disabled.

  • Fixed an issue that caused PyRel to fail when saving model history for a model with a property type that became more specific because of a uniqueness constraint or a calculation across a relationship path.

  • Fixed an issue that caused prescriptive reasoning to accept decision-variable constraints using a list of allowed values, a union of values, or multiple alternatives with | under a different meaning. These forms now fail validation. Prescriptive reasoning is in Public Preview.

  • Fixed an issue that caused model deployment to show an identifier warning even when a deployment did not require a logic reasoner.

  • Fixed an issue that caused a PyRel query to fail when a mathematical expression received an input it could not use, such as a negative number for a square root or zero as a divisor. The affected row now has no value for that expression, and the query returns instead of failing.

  • Fixed an issue that caused some grouped percentile() and median() queries to fail.

  • Fixed an issue that caused prescriptive reasoning constraints to skip entities or groups selected by where(), which could lead to incorrect solver results. Constraints now check every selected entity or group.

  • Fixed an issue that caused some values to be missing from multi-argument prescriptive reasoning decision variables.

  • Fixed an issue that caused Problem.solve() to silently drop an objective calculation with no value and allowed a second objective to fail later or be ignored. It now raises an error for an objective with no value and rejects a second objective when it is added.

  • Fixed an issue that caused PyRel queries to repeat the same join when selecting several properties from one related entity.

  • Fixed an issue that caused a property from a newly created related entity in a PyRel rule to be written as NULL.

  • Fixed an issue that caused Snowflake queries to fail or omit rows when using split_part() with a literal or already-bound index in a negated filter or | default expression.

  • Fixed an issue that caused the PyRel CLI to show a generic error when a reviewed deployment plan was out of date. It now displays a formatted diagnostic and a clearer recovery message.

  • Fixed an issue that caused PyRel to skip whole-number values when loading integer data columns in source tables with missing cells. It now preserves those values and loads missing cells as null.