Skip to content

Python package and CLI 2.3.0

Environment overrides now use the RAI_ prefix.

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.3.0"

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

  • PyRel queries now support Variable.or_() for default values and Variable.and_() for combining conditions, as alternatives to | and &. Group or filter aggregates before applying a default. The names or_ and and_ are now reserved. Rename model relationships with those names, and use bracket access such as table["or_"] for data columns.

  • Model deployment now supports a custom naming function for individual Snowflake objects. Use the function whenever you deploy or query the model with PyRel to avoid changing names or missing views. Before deploying an existing model with PyRel 2.3.0, upgrade every PyRel installation that uses the Snowflake account. The upgrade is irreversible, and older PyRel versions cannot deploy or tear down that model or list models in the account. Review the warning with rai models deploy --plan.

  • Model deployment now supports listing the names and types of Snowflake objects PyRel tracks for a model, including names set by a custom naming function, without reconstructing them from a prefix and suffix.

  • Graph reasoning now accepts an optional name when you create a Graph, helping you distinguish multiple graphs in a model without affecting graph construction or algorithm results. Graph reasoning is in Public Preview.

  • Model deployment refresh schedules can now opt in to batched logging, which may improve refresh time by writing successful block log entries together when a run completes. During the run, rai debugger shows blocks as WAITING. Failed runs record only failure entries. Live logging remains the default.

  • Fixed an issue that caused cumsum_asc() to raise an internal error when deployed models run rules or queries as SQL in Snowflake.

  • Fixed an issue that caused startswith(), endswith(), and contains() to treat _ and % in search values as wildcards instead of literal characters when deployed models run queries as SQL in Snowflake.

  • Fixed an issue that caused recursive rules run as SQL in deployed models to return incomplete or stale results.

  • Fixed an issue that caused pandas reductions to fail on integer query-result columns and, in pandas 3, caused .apply() and .map() to truncate floating-point results.

  • Fixed an issue that caused model deployment to fail or omit subtype rows when subtype data used both SQL and Logic rules. Model definitions must still include the required identity lookups.

  • Fixed an issue that caused deployment plans for an unchanged model using a logic reasoner to differ when generated in different Python processes.

  • Fixed an issue that caused model deployment to fail when a subtype with two parent concepts, an inherited identifying property, and a property of its own was deployed as SQL in Snowflake.

  • Fixed an issue that caused SQL queries to merge entities from different subtypes with the same identifying values, even when identity_includes_type=True was set. Prescriptive models could also merge distinct decision variables or constraints. Redeploy affected models to adopt the corrected SQL schema, which uses a generated _ID key.

  • Fixed an issue that caused lookup fallbacks to return both the existing value and the default or raise a compilation error. A lookup now returns the existing value when present and the fallback only when it is absent.

  • Fixed an issue that caused extra entities, missing properties, or properties on the wrong rows when one rule created entities and another used Concept.lookup() to add properties on the same schedule. If downstream queries depend on SQL column types, check them after redeployment because they may change.

  • Fixed an issue that caused some PyRel queries to fail when using not_() to exclude rows or groups based on aggregates or unions while selecting related values.

  • Fixed an issue that caused concurrent first deployments of a model to create duplicate rows in the Snowflake table PyRel uses to identify the deployed model. If that table has no row or multiple rows, deployment now stops with repair instructions. PyRel does not repair it automatically.

  • Environment variables that override PyRel configuration now require the RAI_ prefix. Replace nested overrides such as COMPILER__STRICT with RAI_COMPILER__STRICT. Unprefixed nested overrides still work temporarily but emit a DeprecationWarning. Generic top-level variables such as DEBUG and MODEL no longer override PyRel settings.

  • When evaluating a predictive model outside model deployment, GNN.score() and RelFM.score() now return the same fields: metric_name, metrics, and split. If your GNN scoring code reads a key such as test_metrics, replace it with metrics and use split to identify the evaluated data subset. Predictive reasoning is in Public Preview.