Commit 00bdc82
fix: restrict prune() to non-cascade Diagrams
prune() removes tables with zero matching rows from the diagram.
For cascade (delete), this is unsafe: between cascade computation
and the actual DELETE, concurrent inserts could add rows to a
pruned table, causing FK errors during delete. Zero-count tables
in the cascade are harmless — delete_quick() on an empty result
is a no-op.
prune() now raises DataJointError on cascade-produced Diagrams.
It remains valid for restrict() (export subsetting) and
unrestricted Diagrams (showing populated tables).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 384f026 commit 00bdc82
2 files changed
+17
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
648 | 648 | | |
649 | 649 | | |
650 | 650 | | |
651 | | - | |
652 | | - | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
653 | 655 | | |
654 | 656 | | |
655 | 657 | | |
| |||
658 | 660 | | |
659 | 661 | | |
660 | 662 | | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
661 | 669 | | |
662 | | - | |
663 | 670 | | |
664 | | - | |
665 | | - | |
666 | | - | |
| 671 | + | |
| 672 | + | |
667 | 673 | | |
668 | 674 | | |
669 | 675 | | |
670 | | - | |
| 676 | + | |
671 | 677 | | |
672 | 678 | | |
673 | 679 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
124 | 124 | | |
125 | 125 | | |
126 | 126 | | |
127 | | - | |
128 | | - | |
| 127 | + | |
| 128 | + | |
129 | 129 | | |
130 | | - | |
131 | | - | |
132 | | - | |
133 | | - | |
134 | | - | |
135 | | - | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
| 130 | + | |
| 131 | + | |
140 | 132 | | |
141 | 133 | | |
142 | 134 | | |
| |||
0 commit comments