Open colleenXu opened 9 months ago
Note: saw post on jmespath design in the JQ stuff, the info may be helpful here. In particular, there's a link to a function's doc string (which may be helpful for understanding what to do for jmespath): https://github.com/biothings/biothings.api/blob/7b83617c40c2f12513a7db6842e5d14adf694039/biothings/web/query/formatter.py#L400
Rohan mentioned in this post (a reply to this comment) and starting here that JQ may be able to do similar behavior.
My impression is that:
But we'd need more discussion before deciding how to proceed + what we want to cover with this issue
@colleenXu that sounds like a good plan to proceed.
Narrowing the scope of this issue to just replacing list_filter
. Using jmespath
to write new issues can be >=1 new issues. Same with using JQ to write new operations.
Note: jmespath seems to be like list_filter, where the fields being acted upon must be included in the initial response (using the parameters.fields). See internal Slack discussion here
because list_filter is a post-query action, the field we filter on MUST be in the response. So yes, this is required
I've heard that
jmespath
should be used in replacement oflist_filter
for BioThings API querying (internal lab Slack thread). At the moment,list_filter
behavior is still working and @newgene said a switch-over was not urgent.However, to do this replacement / use
jmespath
moving forward, I'd need to review the documentation. I have some links here (some are internal lab slack threads):I'm not sure if there is other documentation / info out there, or other info I'd need to adjust existing x-bte annotation and use this going forward...
list_filter
was used for https://github.com/biothings/pending.api/issues/101, and was considered part of https://github.com/biothings/pending.api/issues/100 and https://github.com/biothings/mychem.info/issues/153.I had asked about an enhancement / update to
list_filter
: https://github.com/biothings/pending.api/issues/101#issuecomment-1450688489 and this internal lab slack thread and was told thatjmespath
could potentially address this...