-
Notifications
You must be signed in to change notification settings - Fork 40
Avoid field key collisions in batch edit field lables #7466
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
… of tuples rather than a dictionary
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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
- Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.
When I query with cataloger and collector (agent1) and press batch edit the values get switched. Seems like it has something to do with collector specifically, when I tried with cataloger and determiner it worked fine.
Cataloger and collector:
10-03_16.42.mp4
Cataloger and determiner:
10-03_16.46.mp4
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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
- Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.
Looks good, names and values are correct in batch edit!
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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
- [ x] Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.
Nice work so far!
Bugs:
1. When swapping the ordering in the columns in the QB and and then clicking run. The order is unchanged after the batch edit . Clearing cache did not address this issue
Batch edit:
https://calvertmarinemuseum20250909-issue-7449.test.specifysystems.org/specify/workbench/64
Query:
https://calvertmarinemuseum20250909-issue-7449.test.specifysystems.org/specify/query/39/

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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
Screen.Recording.2025-10-08.at.3.16.24.PM.mov
- Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit.
After swapping, Cataloger incorrectly appears in the third column.
Screen.Recording.2025-10-08.at.3.19.49.PM.mov
@Iwantexpresso @kwhuber Batch Edit has logic that will reorder and add columns in some cases. The import part of this PR is that the column captions in the Batch Edit Workbench are corrected. For this PR, compare the behavior to the main branch. This branch should have the same data as the main branch, but with the correct column names. So the testing examples mentioned in the screen shots look good. I updated the testing instructions to avoid the confusion.
on main: on issue-7449: |
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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
-
Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.
After reviewing these changes with the clarification it looks good. The labels are and the values are correct. and again thank you for the clarification
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 'batch edit' on the saved query and see that the column names are correct and unique for each field's column.
- Try swapping the ordering the the fields in the QB and click run batch edit. See that the ordering is correct in batch edit. Note that Batch Edit has logic that will reorder and add columns in some cases, so compare the data in the batch edit data in the main branch, and make sure this PR has the same data, but with the corrected column names.
pr-7466:



main:

Looks good!
Fixes #7449
This solution converts the localization_dump field labels to a list of tuples rather than a dictionary. This is to avoid field key collisions in batch edit field labels. The code is made a little cleaner with the definitions of the BatchEditMetaTables, TableFieldLabels, and FieldLabel classes. Also, match QueryField objects to their given captions in order to better disambiguate batch edit columns.
Checklist
self-explanatory (or properly documented)
Testing instructions
Cataloger -> GUID
andDeterminations -> Determiner -> GUID
, in this example both resolve toAgent -> GUID
.