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
0.10.0 grammer, elasticsearch transformer, setuptools extra #63
Conversation
Codecov Report
@@ Coverage Diff @@
## master #63 +/- ##
==========================================
+ Coverage 78.17% 80.06% +1.88%
==========================================
Files 21 23 +2
Lines 724 908 +184
==========================================
+ Hits 566 727 +161
- Misses 158 181 +23
Continue to review full report at Codecov.
|
I missed a dependency on the first try. |
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.
Thanks for this @markus1978! Similar to my review of the Django transformer, I've never used ElasticSearch so you're much better equipped to assess your own work, but again this looks really useful. Summary of my comments:
- Could you contribute the grammar to the v0.10 PR [WIP] Adding grammar for v0.9.8 #52 please?
- Could we divide the requirements up further into each backend?
- Do we really need to depend on ASE?
@ml-evs let me respond to your 3 summary points: for 3. I am just using the for 2. Can do for 1. This is the big one. I started with the newest grammar in #52 (0.9.8), but it was not working for me. I guess it is mixing various lark versions? Anyhow, I could not resolve the issues in it. But, the bigger problem is that Transformers are tied to the grammar rules. In a way, you can't really design them independently. I happy to commit my grammar to other places, but I don't really want to adapt the Transformer to another grammar. I think, this will also become an issue for the other transformers, especially when the grammar becomes more and more complex. For example, I tried to make the grammar compatible with the older one, but simply could not find a way to do it. Maybe this even gets to the point, where you have multiple grammars, each per Transformer? |
Hi @markus1978, thanks for your comments and sorry for the delay getting back to you. I've just made a PR #64 for point 2 that splits requirements up per backend (please feel free to review...). Once that's merged I can rebase your PR and switch the requirements around a bit. Regarding 3. you're clearly correct that we need to have backend/transformer-dependent grammars. I'm happy to accept this PR if you make it clear that the grammar you've written is intended for the elasticsearch transformer, then hopefully we can figure out a more general solution at a later date. |
@ml-evs , I changed the grammar file name to v.0.10.0.elastic.g. This way, the grammar is still available via |
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.
Thanks for making those changes @markus1978! Happy to accept.
Sorry for doing multiple things at the same time. But it is all kinda connected.
This PR contains:
server
(as inpip install optimade[server]
) that omits all server/transformer related requirementsUnfortunately, I had to break compatibility with older grammars. The old grammars put AND and OR on the same precedence in contradiction to the spec. The necessary new grammar rules will break transformers on the old grammars.
The tests do not really run the queries on elasticsearch, they only parse the example queries and transform them. I don't have the time to get into the necessary travis ci/elasticsearch setup. Unfortunately, there is no easy mongomock kinda thing for elasticsearch.