Skip to content

5.6 Upgrade Guide

Pre-release

5.6 has not been released yet. This guide describes the current pre-release (5.6.0a1) and may change before the final release.

In this document we describe changes to be aware of when upgrading from orchestrator-core v5.5 to v5.6.

About 5.6

This release introduces: - SQLAlchemy 2.1 - Configurable search export limit

SQLAlchemy 2.1

orchestrator-core now requires SQLAlchemy 2.1. Most applications need no changes, but check the points below and read the SQLAlchemy 2.1 migration guide.

Type annotations

SQLAlchemy 2.1 types Select, Result and Row with PEP 646 variadic generics, so the tuple[...] wrapper is gone. This does not affect runtime behaviour, only static type checking.

# SQLAlchemy 2.0
stmt: Select[tuple[SubscriptionTable]] = select_in_use_by_subscriptions(subscription_id)

# SQLAlchemy 2.1
stmt: Select[SubscriptionTable] = select_in_use_by_subscriptions(subscription_id)

Search your code for Select[tuple[, Result[tuple[ and Row[tuple[ and remove the tuple[...] wrapper. mypy 1.7 or newer is required.

The annotations of these orchestrator-core helpers changed accordingly:

Helper Before Now
services.subscriptions.select_in_use_by_subscriptions Select[tuple[SubscriptionTable]] Select[SubscriptionTable]
services.subscriptions.select_depends_on_subscriptions Select[tuple[SubscriptionTable]] Select[SubscriptionTable]
SubscriptionTable.select_by_product_tag Select[tuple[SubscriptionTable]] Select[SubscriptionTable]
WorkflowTable.select Select Select[WorkflowTable]

Default PostgreSQL driver

A DATABASE_URI without a driver (postgresql://...) now uses psycopg 3 instead of psycopg2. The orchestrator-core default (postgresql+psycopg://...) is unaffected, and psycopg 3 is already a dependency of orchestrator-core. If you override the URI and rely on psycopg2, specify it explicitly: postgresql+psycopg2://....

Other changes

  • Loader strategy classes in sqlalchemy.orm.strategies (e.g. SubqueryLoader) are now private. To check a relationship’s loading strategy, use relationship.lazy instead.
  • Tests that compare compiled SQL strings using postgresql.dialect() now see parameter casts such as %(param)s::VARCHAR. Re-record such snapshots, or compile with an explicit dialect like postgresql.psycopg.dialect().

Configurable search export limit

Search has a new export endpoint, POST /api/search/{entity}/export. It takes the same body as the search endpoints and returns all results in one unpaginated response. How many it returns is set by the new SEARCH_MAX_EXPORT_LIMIT setting, which defaults to 1000. The same limit applies to the saved-query exports (GET /api/search/queries/{id}/export and the GraphQL searchQueryExport). Normal search stays capped at 100.

To export more results, raise the limit:

SEARCH_MAX_EXPORT_LIMIT=10000