-
-
Notifications
You must be signed in to change notification settings - Fork 50
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
RegTAP search: add a flag for including standard auxiliary capabilities #258
RegTAP search: add a flag for including standard auxiliary capabilities #258
Conversation
per astropy#238 Proposed search flag includeaux : boolean Flag for whether to include auxiliary capabilities in results. This may result in duplicate capabilities being returned, especially if the servicetype is not specified. This came up in a NAVO notebook use case, not sure yet if it's exactly what we want.
Codecov Report
@@ Coverage Diff @@
## master #258 +/- ##
=======================================
Coverage 74.94% 74.95%
=======================================
Files 44 44
Lines 5057 5063 +6
=======================================
+ Hits 3790 3795 +5
- Misses 1267 1268 +1
Continue to review full report at Codecov.
|
I'm not a registry expert, but this looks pretty good. I'm not sure what's up with the test failures, it looks like maybe those are related to some kind of mock issue, but once the tests pass I'm good to approve! Thanks for the PR! |
Thanks! I'm not very familiar with fixtures or mocker myself. I'll spend some time working on this and possibly ask around for help, then un-mark it WIP for further review once they pass. |
@cbanek Tests fixed. It looks like one of the remaining failures is needing a milestone; I don't understand the codestyle: commands failed error, caused by the former or otherwise. Please let me know what I should do next, if anything, and thank you for your time! |
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.
LGTM. Milestone set. Leaving for anyone else open to comment for a while. While I think the where clauses that are strings could be maybe combined or something, it's probably better to not complicate that part, since it's really readable the way it is here (and there's all sorts of issues with parens and other things like that).
As commented over in issue #238, this isn't my preferred way to address the underlying use case. But if we do it this way, we shouldn't blindly match anything that ends in aux; that will give far too many false positives (try
(I'd like that better than current main's code whether or not we merge this PR) |
Incidentally: Whatever we do, I suppose we need to touch the service property, too, when we deal with auxiliary capabilities. For now, a startwith approach as in describe would look about ok, but I have to admit I've not really looked at this particular part of the API and frankly suspect this needs to be re-thought a bit because of course there are now many resources that are both, say, SCS and TAP. |
OK, double checking just from a read of the code without having run it, the intention is: Is this right? |
Adjusted tests for queries with includeaux to updated generated query. Additionally, search throws DalQueryError (which it already throws for missing arguments) on provided but bad servicetype argument; relevant pytest added.
Adapted this slightly - we already had a map of accepted servicetypes to standards-names, where users input 'scs' rather than 'conesearch', and used that rather than break it. Given the additional string wrangling around that, the new adql_as_literal does not seem to be needed. If we want to change around this behaviour on a larger scale we can do a separate branch and MR for it. Additionally, added a check for bad servicetype input, added to pytest. |
@cbanek This is currently failing due to lack of changelog, forgive me for not knowing process or being able to find it, should I just edit CHANGES.rst or is there some other process that will pick it up? |
@theresadower - you need to update the |
To retain functionality which was existent before the includeaux flag, accept both servicetype acronyms (sia, csc) and descriptive names (image, conesearch) listed as keys and values in the service_type_map structure.
This looks good to me, is everyone happy with this and ready to go? |
Looks good to me too. |
Proposed search flag includeaux : boolean, default false.
This flag controls whether to include auxiliary capabilities (with standard interfaces) in registry search results. This may result in duplicate capabilities being returned, especially if the servicetype is not specified, and therefore remains default off.
This behavior is discussed in #238 . The issue originally arose in a NAVO-run pyvo workshop at AAS, where a workflow of performing cone searches and then moving to a related TAP service for more fine-grained queries and additional filtering didn't work as expected. @trjaffe and @tomdonaldson can comment further from the workshop experience.