Skip to content

Breaking changes

For each release that requires a change in your code, halfORM ships a note saying what changed and what to write instead. Those notes live inside the installed package, in half_orm/migrations/, where upgrade tooling reads them through get_breaking_changes_dir() — so what you read here and what half_orm dev shows you before an upgrade are the same text, not two copies of it.

For everything else in a release — fixes, additions, behaviour changes that do not break an API — see the CHANGELOG.

Coming from a release before 1.0

Every version before 1.0.0 was published as Beta (Development Status :: 4 - Beta), and the 0.18 line still carries that classifier. 1.0.0 was the first release declared Production/Stable; 1.1.0 is the current stable release, and the one to be on.

If you are still on 0.x, the upgrade is worth planning rather than postponing:

  • Read the 1.0.0 notes below. The jump crosses them, and they are the changes that will not happen silently.
  • Read the CHANGELOG for 1.1.0, which describes several behaviour changes that break nothing at the API level but change what your code does — a configuration file saying production = false was being read as true, for one.
  • Know what you keep by staying: the 0.18 line is in maintenance and received only part of the 1.1 security work. What it did not receive is listed in the 0.18 advisory, and order_by is on that list.

Releases that require changes to your code: 1.0.0.

half-orm 1.0.0 — Breaking Changes

ho_get() returns a dict and raises on 0 or >1 rows

ho_get() now returns a plain dict directly (no longer a Relation object). It raises: - NotFoundError if no row matches - MultipleRowsError if more than one row matches

Before:

obj = MyTable(id=1).ho_get()  # returned a Relation

After:

row = MyTable(id=1).ho_get()  # returns dict, or raises

The async counterpart ho_aget() has been added with the same semantics.

Deprecated query-builder setters removed

ho_limit, ho_offset, ho_order_by, ho_distinct no longer exist as property setters. Pass them as keyword arguments to ho_select().

Before:

rel.ho_limit = 10
rel.ho_order_by = "name"
for row in rel.ho_select():
    ...

After:

for row in rel.ho_select(limit=10, order_by="name"):
    ...

FKEYS_PROPERTIES / FKEYS class attributes removed

Use Fkeys only. Any subclass that still defines FKEYS_PROPERTIES or FKEYS will raise an error at class definition time.

ho_cast() raises CastError for invalid inheritance targets

ho_cast(TargetClass) now raises half_orm.relation_errors.CastError if TargetClass is not in the PostgreSQL inheritance hierarchy of the source table.