Skip to content

DataJoint Library 2.3.5

Latest

Choose a tag to compare

@dimitri-yatsenko dimitri-yatsenko released this 21 Oct 16:24
· 27 commits to master since this release
1ba8b9f

Fixes deletes, drops, and alter() renames that removed data they should have kept.

A patch release on the 2.3 line, recommended for every 2.3 deployment. There are no API changes.

Deletes

  • A cascade delete removes only the rows it reaches (#1589, #1590, #1591; #1593):

    • (T & dj.Top(n)).delete() and delete_quick() start from the rows the Top selects. Before, they started from every row matching the other conditions.
    • A child whose nullable foreign key shares a primary-key column with the parent keeps the rows whose foreign key is NULL. In a diamond, a child reached through a secondary foreign key is now deleted, instead of the delete failing with an "unloaded schema" error.
    • With part_integrity="cascade", a master joins the delete only if one of its part rows does.

    On earlier releases, restrict the delete by the keys it should remove: (T & (T & cond).keys()).delete().

Tables

  • On PostgreSQL, dropping a table no longer drops columns of other tables that share an enum type (#1630; #1633). Every jobs table has the same status enum, so dropping one jobs table used to remove status from all the others in the schema.
  • alter() keeps an attribute's values when it renames a core-type attribute (#1631; #1635). On MySQL the rename is a CHANGE. On PostgreSQL, alter() refuses the rename before changing anything; renaming there comes in 2.4.
  • alter() resolves foreign keys in the module that declared the table, not the caller's (#1602; #1618).

Jobs

  • A restricted populate(reserve_jobs=True) keeps other workers' reservations and error records (#1594; #1597). Cleanup checks keys against the full key_source; the restrictions only limit which jobs are added. Success and error records of deleted rows go on every refresh.
  • completed_time is recorded to the millisecond, so it can no longer precede reserved_time (#1600; #1614).

Errors

  • MySQL error 1143 (SELECT denied on a column) raises dj.errors.AccessError, as error 1142 already did (#1586; #1599). Contributed by @Bhanu73120.

Python

  • Python 3.15 is supported: requires-python is now >=3.10,<3.16 (#1598). On 3.15 only, deepdiff stays below 9 until its dependencies publish 3.15 wheels.

Known limitations, fixed in 2.4

  • A delete restricted by another query, such as (Subject & (Session & "quality = 0")).delete(), raises or deletes nothing, and so does one whose restriction contains % (#1610, #1636). Restrict by the keys instead: (T & (T & cond).keys()).delete().
  • Diagram.restrict() ignores a dj.Top seed and shows every matching row. This affects the preview only, not deletes.