Fix duplicate nodes being removed in tree imports#7863
Fix duplicate nodes being removed in tree imports#7863alesan99 wants to merge 3 commits intov7.12.0-prereleasefrom
Conversation
|
I have personally checked the following trees so far:
This tree looks like it gains extra records
Though this is likely only because the tree file is formatted differently. It should still be the same number of records if reformatted, but I haven't verified it. |
lexiclevenger
left a comment
There was a problem hiding this comment.
- The taxon tree in Specify and the csv file should have the same number of trees.
Based on the query below, the counts for Ichthyology and Mammology match those in the CSV.
The following do not match::
Fungi: CSV 159,229, Query, 159,232
Herpetology: CSV 24,730, Query 24,732
Invertebrate: CSV 79,276 Query 79,282
Database: lsumz_herps_2025_09_09
There was a problem hiding this comment.
- The taxon tree in Specify and the csv file should have the same number of trees.
--
There is discrepancy in some trees the number of records uploaded versus the number of records in the query.
Botany (bryophyta):
Uploaded: 14425
Queried: 14428
Mammals:
Uploaded: 13557
Queried: 13557
Minerals:
Uploaded: 6202
Queried: 6202
I am changing requests because I had mixed results and also the number of records uploaded were different from the .json file. (eg. minerals was 6189 rows but 6202 got uploaded).
|
It looks like nodes were being added to the incorrect parents all along (even on main) if there were multiple parents with the same name in the same rank. |
Fixes #7853
Tree imports de-duplicate nodes with the same name (ParentNode -> ChildNode1 and ParentNode -> ChildNode2 need to have the same).
However, it looks like some tree files intentionally have non-parent nodes with the same names. To allows those to be imported, I disabled de-duplication for leaf nodes.
Dev note: Also added some minor fixes to some mistakes I saw in the code
Checklist
self-explanatory (or properly documented)
specify7/specifyweb/specify/management/commands/run_key_migration_functions.py
Line 50 in ea04665
Testing instructions
"file":)