-
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
Introduce grammar v0.10.1 #112
Conversation
Codecov Report
@@ Coverage Diff @@
## master #112 +/- ##
=======================================
Coverage 84.86% 84.86%
=======================================
Files 39 39
Lines 1817 1817
=======================================
Hits 1542 1542
Misses 275 275
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.
This also looks good to me, are we expecting any further grammar changes before 0.10.1, or can we get this merged?
Not at the moment - but since v0.10.1 is not officially out, there definitely may come some. But most likely not for the grammar - so this should be good to go @ml-evs once approved. |
Newest commit should also address the fact that |
d70e3e2
to
ed7c985
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.
This LGTM, though I'm trusting the grammar tests to spot any issues in the grammar file itself!
50c16b9
to
bdef029
Compare
This PR doesn't really address the usage of the grammar, only the grammar itself. With respect to "the interrim" here, do you mean after or before merging this PR? |
Misunderstanding: I thought length queries didn't work at all before this.
After! |
0c01508
to
9cd2929
Compare
Right - I can see from the diff here that it's basically impossible to see the changes from v0.10.0.
|
The only issue I'm having, is how to clearly make a We could probably do it in the transformer, but that's backend-specific, so one would have to always implement it for all transformers, which seems a bit weird. So I'd rather implement this in the grammar itself, in some way. Also, is it fine if one of the |
Since this PR updates the package version, I think I'm going to push and publish a tag to |
2099a19
to
4e7c0ed
Compare
Update from v0.10.0: Implement Materials-Consortia/OPTIMADE#221
Co-Authored-By: Matthew Evans <[email protected]>
4e0f3f0
to
3cd55cc
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.
This is looking very close now @CasperWA!
As this constant <op> constant
stuff is turning out to be quite fiddly, would you mind adding a couple of negative tests that show it raising the error? If it's something that has to be handled in the transformers, it would be good if the test is there and skipped even if its not working correctly as of this PR.
Working on it now. Could you possibly just push the changes you had in mind concerning using EDIT: Reading the stackoverflow page @fekad has linked to in the transformer, it seems the intent was more to not use $where, but instead add information to an extra? |
Yeah it probably needs a bit more discussion on that issue (so I won't add anything to this PR), I'll write my thoughts there when I get a sec |
There is no need to have the old MongoTransformer. The current MongoTransformer should work for the newest grammar always. Either that or one should create a new Transformer per grammar version - this may be desired. Start to convert previously skipped tests to run, using `assertRaises` for not yet implemented parts.
Also does this currently close #82? |
Technically, yes. But as stated in the issue, the Transformer should be further tested, so that we now it truly works. But it should... At least for However, does not work (as far as I know) for |
Does this also need to be updated? Currently the mongo tests run against the old grammar. |
A special grammar expression `not_implemented_string` is used to detect if strings are compared, while still making sure the Transformer can handle the error. This should be removed when comparisons of strings are properly documented in the specification.
This is for all "valid" filter statement that have not yet been implemented in the Transformer.
Yup, it does. And it has. Feel free to re-review :) |
Thinking a bit more about this, I am not so sure this is true. There are several comparisons done in EDIT: Hmm... but then, reading the spec, it seems the RHS comparisons are only valid for logical operators, which is exactly what |
I think either way we should try to get this merged so we can have a chance to break it. There's still things to discuss in #86 and #98 for us to be completely compliant with 0.10.1 but this PR is both very large and very useful :) I'm happy to accept this as is, and you can decide whether you want to add some further tests for RHS comparisons (and whether to close #82) before merging! |
Is it all right to merge this, publish it as version 0.3.0 and then perhaps start using a |
Makes sense to me. |
Update from v0.10.0: Implement Materials-Consortia/OPTIMADE#221
I guess this needs some more additions as the OPTiMaDe spec is updated to v0.10.1.
IMPORTANT: This PR will up the package version to
0.3.0
and the OPTiMaDe version to0.10.1
.