What's New in Version 1.23.0
Version 1.23.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 keep the capitalization of your column names when you deploy a model to Snowflake. By default, PyRel converts unquoted column names to all upper case, so a property named
EntityIddeploys as the columnENTITYID. To keep the case you declared instead, setpreserve_column_case: truein thedeploymentsection of yourraiconfig.yaml(DeploymentConfig):deployment:preserve_column_case: true # default: falseThis applies to column names only, not table names. With the option on, PyRel quotes the columns, so the names become case-sensitive in Snowflake. Query them with the exact case and quotes, such as
"EntityId". -
You can now name a relationship field that holds more than one kind of entity using the pipe operator
|or theunion()function. This is useful when a field can point to instances of different concepts, such as an account owned by either anIndividualor anOrganization:Account.owner = m.Relationship(f"{Account} owned by {(Individual | Organization):owner}")# equivalently:Account.owner = m.Relationship(f"{Account} owned by {union(Individual, Organization):owner}")Each option must be a concrete entity type, such as
IndividualorOrganization, rather than a value type like a number or string. A union must list at least two.
Bug Fixes
Section titled “Bug Fixes”-
Fixed a bug that caused some model deployments to fail with a
NotImplementedErrorand produce incomplete output tables. -
Fixed a bug that caused the refresh task for some deployed models to fail with a Snowflake error or to produce empty tables.
-
Fixed queries that read two fields from the same multi-field
Propertyin oneselect(), such asselect(invoice.total["currency"], invoice.total["amount"]), wheninvoicecomes from a nestedselect()that returns more than one invoice.Before 1.23.0, PyRel could mix rows across invoices, returning every invoice’s field values for each invoice instead of only its own. Now each invoice returns only its own values. This bug only affected
Propertyinstances, notRelationshipinstances, which always return the stored pairs correctly.# `invoice` comes from an inner select(), then an outer select() reads# two fields of the same multi-field property:invoice = model.where(Invoice.overdue).select(Invoice)[0]model.select(invoice.total["currency"], invoice.total["amount"]) -
rai models pullno longer blocks a pull just because your branch has its own local changes. Before this release, PyRel could mistake those local changes for a conflict and block the pull. Now a pull is blocked only when your changes actually conflict with the shared history.