fix(querybuilder): Use correct formatting in QueryBuilder#7512
Merged
grantfitzsimmons merged 4 commits intomainfrom Oct 30, 2025
Merged
fix(querybuilder): Use correct formatting in QueryBuilder#7512grantfitzsimmons merged 4 commits intomainfrom
grantfitzsimmons merged 4 commits intomainfrom
Conversation
Triggered by f55bd44 on branch refs/heads/issue-7510
emenslin
approved these changes
Oct 24, 2025
Collaborator
There was a problem hiding this comment.
- Create a table format that includes a boolean field value (e.g.
isPrimaryor ayesNofield) - See that the preview in the table format editor shows "Yes" or "No" where a value is present
- Run a query that returns that format
- See that the appropriate value is not displayed in
v7.11.2.1 - See that the appropriate value is displayed in
issue-7510
Looks good, in query results a 1/0 is shown for a boolean field

I did notice though that if you try to batch edit with the format that includes the boolean field that it looks incorrect. It has the same behavior in main though so I am not sure if this is a problem for this PR or not so I will approve but I can rereview if this is something that needs to be fixed here or write up an issue if this is out of scope for this PR.

grantfitzsimmons
approved these changes
Oct 25, 2025
Member
grantfitzsimmons
left a comment
There was a problem hiding this comment.
- Create a table format that includes a boolean field value (e.g.
isPrimaryor ayesNofield) - See that the preview in the table format editor shows "Yes" or "No" where a value is present
- Run a query that returns that format
- See that the appropriate value is not displayed in
v7.11.2.1 - See that the appropriate value is displayed in
issue-7510
acwhite211
approved these changes
Oct 27, 2025
alesan99
approved these changes
Oct 27, 2025
Contributor
alesan99
left a comment
There was a problem hiding this comment.
- Create a table format that includes a boolean field value (e.g.
isPrimaryor ayesNofield) - See that the preview in the table format editor shows "Yes" or "No" where a value is present
- Run a query that returns that format
- See that the appropriate value is not displayed in
v7.11.2.1 - See that the appropriate value is displayed in
issue-7510
Formatters appear as expected now 👍
Member
|
CSIRO confirmed this fix is good as well on Asana @melton-jason |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Fixes #7510
See related #7080
The underlying problem was due to how the default formatter props for query execution were being interpreted and constructed, as well as the value of the
format_exprbeing interpreted inSpecifically, the problem stemmed from the defined default values of
ObjectFormatterProps:specify7/specifyweb/backend/stored_queries/format.py
Lines 43 to 50 in b6a6a7b
Each of the values ending in a comma were being interpreted as one-tuples when it's clear they were meant to be booleans. For illustration, the above was being interpreted as the following:
This led to issues when the default was used in the
executefunction instored_queries/execution.py:specify7/specifyweb/backend/stored_queries/execution.py
Line 792 in b6a6a7b
specify7/specifyweb/backend/stored_queries/execution.py
Line 808 in b6a6a7b
Thus there were two issues with the default
formatter_props:format_exprvalues in the ObjectFormatterProps was being interpreted incorrectlyformat_exprshould byTrue. The defaultObjectFormatterPropshas aFalseformat_exprI think we should evaluate whether or not to change the default
format_exprinObjectFormatterPropstoTrue, especially if the only case for it beingFalseis batch edit.Checklist
self-explanatory (or properly documented)
Testing instructions
isPrimaryor ayesNofield)v7.11.2.1issue-7510