-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Catch sqlite exceptions when filter entities #6601
Open
grzesiek2010
wants to merge
3
commits into
getodk:master
Choose a base branch
from
grzesiek2010:COLLECT-6600
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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.
works correctly in the optimized way
-- what makes it optimized? This looks like it fell through which I thought would be non-optimized.This test looks identical to https://github.com/getodk/collect/pull/6601/files#diff-4a25b4c0ba0780186c2edabe26d8518d4e3e6a022a482669373e2a71ceac6dfbR585 to me
In this test
not_existing_property
is the reference in the secondary instance and'value'
is a static value.In the test above,
undefined
is the reference in the secondary instance and/data/ref_question
is a static value that came from the form.It's confusing because the order is different and the intended meaning is different! But I believe that from the system's standpoint they should be in the same category. If there's code somewhere that treats them as different we should dig into it, I think.
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.
I made a mistake in the title it's not optimized of course. I will fix that.
If you set
not_existing_property='value'
, it will always return an empty list of entities (becausenot_existing_property
does not exist).However, if you use
undefined=/data/ref_question
or'value'=/data/ref_question
(because we focus too much on theundefined
case), the list won't be empty - as long as the expected value matches the one entered in the question.Wouldn't it be enough to treat these two cases as distinct and have separate tests for each?
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.
And with
not_existing_property=''
, you should always get all Entities. That's the same as theundefined=/data/ref_question
case when/data/ref_question
has a blank value.I sort of see the distinction that you're making, thanks for explaining it again, that was helpful. It doesn't hurt to have a few extra tests and I don't think there's a fundamental misunderstanding here. 👍
This one does definitely feel different from the other two to me. This should be identified as not an expression that can use the optimized filter strategy and bypass before it even gets there (maybe good to double check this?). The other two should be identified as candidates for the filter strategy and then be kicked back to the next one once the column is determined to be unknown.