-
Notifications
You must be signed in to change notification settings - Fork 42
Handle Disambiguation Case for Host Taxon in QB Results #7509
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
emenslin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Run the query and see that the fields from the different paths are different. The ones from 'Host Taxon' should have the 'Host' in the column name.
- Find an example row in the results where the values from the taxon and host taxon are different.
- Test other tree based queries to make sure that they still work correctly.
The taxon and host taxon problem seems to be fixed but I am running into issues with the gegraphy and storage queries. When I try to query for state -> full name and county -> full name I get an error that doesn't happen in main. I'm not sure if this is happening on other queries as I was running into issues with queries in general running very slowly.
Main:
10-22_13.23.mp4
Issue branch:
10-22_13.25.mp4
Error message:
Specify 7 Crash Report - 2025-10-22T18_25_19.960Z.txt
|
Thanks @emenslin. I pushed a change that fixes the issue in Geography and Storage. It should also help some with performance, let me know if the queries are still slow for you. I'm going to test some more on larger databases to test performance. |
emenslin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Run the query and see that the fields from the different paths are different. The ones from 'Host Taxon' should have the 'Host' in the column name.
- Find an example row in the results where the values from the taxon and host taxon are different.
- Test other tree based queries to make sure that they still work correctly.
Looks good, I'm no longer getting an error on geography and storage queries.
Fixes #7436
On the front-end, allow for the disambiguation between taxon and host taxon columns in the QB results. Implement this as a special case in the
generateMappingPathPreviewfunction on the front-end. This will show the columnCollectingEvent->CollectingEventAttribute->HostTaxon->Genius->FullNameto be displayed asHost - Genus - Full name, rather thanGenus - Full name. This allows the user to differentiate between other paths from Taxon.This resolves the specific case described in the issue. If we want a more general solution that can resolve any disambiguation between fields in the QB results, then we'll need to design a more complex solution on the front-end. That solution would need to be different from
generateMappingPathPreview, as it would need to have the context of all the fields in the query, and then have some way of deciding on alternative names when disambiguation as needed.The issue on the back-end is with the query that gets generated:
You can see in the query that
taxon_18, which is associated with the CollectingEventAttribute Taxon, is not used the select clause. So, theanon_2alias select clause in this case should have:The solution is to change the join_cache key from (table, 'TreeRanks') → (start_alias, 'TreeRanks'), preventing the host branch from reusing the determination branch’s chain. I'm investigating to make sure that this change is ok for other tree queries.
Before:

After:

Checklist
self-explanatory (or properly documented)
Testing instructions