What's Changed
For a comprehensive overview of all new features, see What's New in DataJoint 2.2.
Added
- Graph-driven cascade delete and restrict on Diagram (#1407, fixes #865, #1110): New
Diagram.cascade(),Diagram.restrict(),Diagram.prune(), andDiagram.counts()methods replace the error-driven cascade approach. Delete and drop operations now use the pipeline DAG to determine affected tables before executing, with full dry-run support viasafemode=True. - Thread-safe mode with
dj.Instance(#1404): Newdj.Instance()class provides independent database connections with connection-scoped configuration. Enables safe concurrent access from multiple threads (e.g., web servers, parallel workers). - Directory references in
<filepath@store>(#1415, fixes #1410): Filepath storage now supports directory references.is_diris detected dynamically; existence checks and storage operations handle directories correctly.
Fixed
populate()withreserve_jobs=Trueignores restrictions (#1414, fixes #1413): Restrictions are now correctly applied when fetching pending keys in distributed mode, matching the behavior of direct (non-distributed) populate.- Populate antijoin uses
.proj()for correct pending key computation (#1405): Fixes cases where overlapping secondary attributes caused incorrect pending key calculations. - Allow attribute names starting with 'index' in declarations (#1412, fixes #1411): Table definitions with attribute names like
index_valueno longer raise parse errors. - Cascade delete failures on MySQL 8 (fixes #1110): The graph-driven cascade in #1407 eliminates the error code mismatch (1217 vs 1451) that caused cascade delete failures on MySQL 8.
Changed
- Backend-agnostic quoting and adapter abstractions (#1419): Refactored identifier quoting, table name construction, and schema queries into adapter methods for cleaner multi-backend (MySQL + PostgreSQL) support.
skip_duplicates=Truebehavior documented for PostgreSQL (#1417, fixes #1049): PostgreSQL already enforces secondary unique constraints whenskip_duplicates=True(raisesDuplicateErroron secondary unique conflicts, unlike MySQL which skips silently). This asymmetry is now documented and tested.
Full Changelog: v2.1.1...v2.2.0