-
Notifications
You must be signed in to change notification settings - Fork 6
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
Check Qnode/Qedge properties #125
Conversation
Codecov Report
@@ Coverage Diff @@
## main #125 +/- ##
==========================================
- Coverage 59.91% 53.48% -6.43%
==========================================
Files 25 26 +1
Lines 2365 2307 -58
==========================================
- Hits 1417 1234 -183
- Misses 948 1073 +125
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
looks like QEdge is missing some specified fields? like |
@andrewsu and I wondered if the TRAPI spec could be used, rather than hard-coded constants. BTE stores a modified TRAPI spec locally and it has the sections for QNode and QEdge Note that I haven't tested this PR; I've only commented after looking at the files changed... EDIT: linking the requirements in the original issue biothings/biothings_explorer#503. |
Agreed, it would probably be best to dynamically check using the TRAPI spec rather than using hard-coded values. |
Wrote some code to use TRAPI Spec, required some code in the main BTE repo as well, will push soon under same branch name (may break tests due to changes in TRAPIQueryHandler constructor, will address soon). Also, while testing I found out that for some reason QEdge.constraints was being used in the code even thought that isn't in the TRAPI spec? (I got an error when making it to a string) |
The previous QEdge.constraints work is likely from this stuff biothings/biothings_explorer#302, biothings/biothings_explorer#174 (comment). I think it is currently broken, and the TRAPI spec changed it from QEdge.constraints to QEdge.attribute_constraints. Also, I think @tokebe would be the one to comment on whether the new commits / PR biothings/biothings_explorer#513 make sense (I'm a bit surprised that the whole openapi spec is parsed). If it seems fine, then someone could go forward with testing this set of PRs to see if they solve the issue. I wonder if anyone feels comfortable handling this? Or it can be put in the pile for me to test later :P |
@colleenXu the spec is parsed once during startup and then held in memory for query validation using swagger. @rjawesome If you could edit your new PR to only read/parse the spec once (perhaps when utils is imported or something similar) that would be better. Reading/parsing the whole thing for each query would probably add a not-insignificant delay and memory overhead to handling requests. |
Also @colleenXu I can handle testing when it's ready. |
@rjawesome Based on your changes this looks good -- if you think it's ready now then I'll do some quick testing and merge to dev for final testing. One nitpick prior to that, however: I'd prefer BTE's logs to be less "human" to fit with the general tone of the rest of our logs ( |
Yeah I believe it's ready, I can change the logs if needed. |
Please do, I'll get testing in the meantime. |
Logs fixed |
Solves issue