What's New in Version 1.0.17
Version 1.0.17 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”-
PyRel now supports
math.round(). You can round to the nearest integer or to a specified number of decimal places inside semantics expressions. -
rai debuggernow makes compiler output easier to inspect. You can choose which compiler steps to show in one dialog, see clearer color coding, and view job IDs directly in the UI. Before, you had to toggle those steps one by one and query cards did not show the job ID. -
You can no longer create a property or relationship on a concept named
Relationship,Property,Concept, orTable. If you try to use one of these names, PyRel raises an error such as:'Relationship' is a reserved name and cannot be used as a relationship name on concept 'Person'.For example:
from relationalai.semantics import Model, Stringm = Model()Person = m.Concept("Person")# AllowedPerson.relationship = m.Property(f"{Person} has {String:relationship}")# Raises the reserved-name errorPerson.Relationship = m.Property(f"{Person} has {String:relationship}")
Bug Fixes
Section titled “Bug Fixes”-
Fixed a slowdown when you ran the first query on a second model in the same Python process. Before, PyRel could check data sources from all models instead of only the model you were querying. Now each model keeps its own data sources, so queries check only the relevant ones.
-
Fixed exports to Snowflake tables when you declare the destination schema with
Model.Table(). Before, if the destination schema had more columns than the current export produced, PyRel could leave out the extra declared columns. Now it keeps those columns and fills missing values withNULL, so later writes to the same table can still succeed.For example:
from relationalai.semantics import Integer, Model, Stringm = Model("MyModel")Order = m.Concept("Order", identify_by={"id": Integer})Order.status = m.Property(f"{Order} has {String:status}")# This query exports only order_id and status.q = m.select(Order.id.alias("order_id"), Order.status)# The destination schema also declares shipped_at.out = m.Table("ANALYTICS.PUBLIC.ORDER_EXPORT",schema={"order_id": Integer,"status": String,"shipped_at": String,},)q.into(out).exec()# In 1.0.17, shipped_at stays in the exported Snowflake table and is filled with NULL. -
Fixed fully qualified Snowflake names that use quoted lowercase or mixed-case object names. Before, PyRel could strip the quotes from names such as
ANALYTICS.PUBLIC."orders"orANALYTICS.PUBLIC."SalesSummary". That could make Snowflake read them asANALYTICS.PUBLIC.ORDERSorANALYTICS.PUBLIC.SALESSUMMARY, which might be different objects or might not even exist. Now PyRel preserves those quotes.