unite_master_parts
breaks topological order of descendants and thus breaks cascading of table drops
#1057
Labels
unite_master_parts
breaks topological order of descendants and thus breaks cascading of table drops
#1057
Bug Report
Description
unite_master_parts
does not always preserve topological order when reordering the list of tables and causes issues when dropping tables.Reproducibility
Expected Behavior
Notice that datajoint was trying to drop
M1
before droppingM.Part
. The expected behavior should be droppingM.Part
,M
, and thenM1
.Additional Research and Context
I dig into the code a little bit and realized datajoint would first collect all descendants of the table to drop, sort them by topological order, reorder the sorted list to unite master and part tables (
unite_master_parts
, which should not disrupt the topological sort), and then drop the tables in topological order.However,
unite_master_parts
does not actually preserve topological order.In the above example, the topologically sorted list of tables happens to be:
and
unite_master_parts
would reorder the list to be:which is not topologically sorted and would cause issues when dropping tables.
This issue is probably also related to the behavior mentioned in #927 (comment)
The text was updated successfully, but these errors were encountered: