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 querying capabilities to fetch_runs_table #1660
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1660 +/- ##
==========================================
- Coverage 80.58% 77.10% -3.48%
==========================================
Files 302 302
Lines 15484 15538 +54
==========================================
- Hits 12478 11981 -497
- Misses 3006 3557 +551
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
fa97b95
to
284a271
Compare
assert len(runs_table) == 1 | ||
assert runs_table[0].get_attribute_value("sys/id") == run_id1 | ||
if with_query: | ||
kwargs = {"query": f"(sys/tags: stringSet CONTAINS '{tag1}')"} |
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.
In the UI, CONTAINS
is not available for tags. For tags, owner, state, and stage we have ONE OF
, but I guess that's not supported API-side. Are we OK with such inconsistency? Are the differences outlined anywhere?
To document this properly, I'd need to understand exactly how the query syntax compares to we have here: https://docs.neptune.ai/app/searching_table/#syntax
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.
My best bet is that ONE OF
is translated in the frontend to expression that is using CONTAINS
instead (I didn't confirm that with anyone).
If you take a look at nql grammar definition there is no ONE OF
keyword so there is no way to run raw queries (which we are enabling) that are using this type of expression.
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.
UPDATE @normandy7 :
Yep thats what I thought. There is frontend test that confirms that
So basically there is backend NQL syntax, and frontend NQL syntax. Backend NQL does not contain ONE OF
expression but frontend NQL does and is later on translated to backend NQL syntax which gets rid of ONE OF
using CONTAINS
.
We are running queries against backend so we have to use NQL which does not contain ONE OF
expression (and is not accurately documented). So if we are not going to change backend NQL there is no way around this difference. (We might do similar translation thats happening in frontend but thats out of scope for raw string queries)
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 finding out!
That's a bummer, though. I suppose we have to live with this, but from an end-user POV it can be annoying/confusing. CC: @parthpankajtiwary
- add RawNQLQuery which represents raw string query - add eval() method to all NQLQuery classes which returns simplified version of type
…lity - all test that use fetch_runs_tables now are parametrized to include query (even trival cases) in one of the cases - new test are added
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
3f1fdf8
to
c6e4675
Compare
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
Co-authored-by: Sabine <sabine.nyholm@neptune.ai>
Before submitting checklist