-
Notifications
You must be signed in to change notification settings - Fork 44
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
Add null check to mongo filtertransformer for KNOWN/UNKNOWN filters #279
Conversation
7caecde
to
15d48e4
Compare
Codecov Report
@@ Coverage Diff @@
## master #279 +/- ##
==========================================
+ Coverage 89.94% 90.03% +0.09%
==========================================
Files 54 54
Lines 2248 2269 +21
==========================================
+ Hits 2022 2043 +21
Misses 226 226
Continue to review full report at Codecov.
|
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.
Looks good to me.
15d48e4
to
cb7abb7
Compare
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 like the use of all these postprocesses you've set up, cheers @ml-evs !
I am having some trouble wrapping my head around the logical consequences of what should be the result of each of these. I guess I should read the spec more carefully on these points.
Co-authored-by: CasperWelzel Andersen <[email protected]>
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.
It's quite a verbose edition of the transformer now, but with these things, it's for the better I think.
Cheers @ml-evs
Yeah, there's no other way to handle these edge cases with just lark, unless we can get to the field names directly (I gave up trying to do that a while ago). Hopefully this is the last one! |
I think that would be a grave mistake, and if that is needed we have done something very wrong. |
Closes #254, by adding comparison against
null
during KNOWN/UNKNOWN filters.This had to be added as another post-processor, due to the mismatch between Lark/mongo. There is also some additional logic to handle the case of e.g.
NOT x is UNKNOWN
. This was achieved by adding a dummy magic keyword "#known" when building the lark query, which is then expanded out by the post-processor after theNOT (expr)
rule has been applied.