What's New in Version 1.0.5
Version 1.0.5 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”-
Added explicit
schema=support todata()andModel.data(). Before, PyRel always inferred column types from the in-memory rows or DataFrame you provided, which made empty inputs and ambiguous columns harder to control. Now you can declare some or all column types explicitly, and the returnedDataobject preserves those types even when the input is empty.For example:
from relationalai.semantics import Date, Integer, Model, Stringm = Model("OpsModel")# A daily exceptions feed can legitimately be empty, but downstream logic# still needs stable column types.shipment_exceptions = m.data([],schema={"order_id": Integer,"warehouse": String,"reason": String,"requested_ship_date": Date,},)# You can still use the schema in model logic, even with no rows.ShipmentException = m.Concept("ShipmentException")m.define(ShipmentException.new(shipment_exceptions.to_schema())) -
PyRel now supports batching multiple pending table exports into a single model execution. Before, export-heavy workflows had to execute table exports separately. Now you can queue multiple
.into()exports and submit them together withm.exec():# Create two export fragments.m.select(Customer.id, Customer.name).into(customer_table)m.select(Product.id, Product.name).into(product_table)# Execute both exports together in a single model execution.m.exec()
Bug Fixes
Section titled “Bug Fixes”-
Improved dtype inference for pandas float columns. Before, dataframe float columns could be inferred as a more generic numeric type. Now PyRel maps pandas float columns to
Float, which keeps inferred schemas closer to the original dataframe types. -
Fixed table-based schema and column mapping when
model.implicit_propertiesis disabled.model.implicit_propertiescontrols whether PyRel creates undeclared properties automatically. Before, when you turned this option off,Tableobjects could still implicitly create properties. NowTableobjects respect themodel.implicit_propertiessetting, so you can disable implicit properties for tables as well as concepts. -
Fixed use of
std.datetime.datetime.now()in queries and filters. Before, using the current date and time in a query or filter could fail with an argument error. Now you can usestd.datetime.datetime.now()directly in PyRel logic, including in time-based derived definitions.For example:
from relationalai.semantics import DateTime, Integer, Model, stdfrom relationalai.semantics.std.datetime import datetimem = Model("OpsModel")# Declare the base shipment concept.Shipment = m.Concept("Shipment", identify_by={"id": Integer})# Add the promised ship timestamp.Shipment.promised_ship_at = m.Property(f"{Shipment} promised ship at {DateTime}")OverdueShipments = m.Concept("OverdueShipments", extends=[Shipment])# Define some shipment entities.m.define(Shipment.new(id=1, promised_ship_at=datetime(2026, 3, 17, 9, 0)),Shipment.new(id=2, promised_ship_at=datetime(2026, 3, 28, 9, 0)),)# Define overdue shipments using the current time.m.define(OverdueShipments(Shipment)).where(Shipment.promised_ship_at < std.datetime.datetime.now(),) -
Fixed
ProgrammaticAccessTokenAuthso PAT-based Snowflake authentication includes the requireduserfield and expands~intoken_file_path. Before, Snowflake could reject the PAT as invalid, and token files referenced with~could fail withFileNotFoundError. Now PAT authentication works in both cases. -
Fixed
Problem.solve()so it uses the app name from the model config. Before,Problem.solve()could ignore a customrai_app_namein the model config. Now it reuses the configured app name. -
Fixed
create_config()for PyRel running inside an existing Snowflake session, including notebooks, stored procedures, and SPCS containers. Before, the returned config could fail when PyRel later needed a Snowflake SQL connection. Now configs created from active sessions work correctly in those environments. -
Fixed notebook diagnostics so notebook users see all collected PyRel diagnostics in a single exception. Before, earlier diagnostics could be easy to miss, so you often saw only the final failure. Now notebook exceptions include the diagnostic context that led to the error.