-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Ensure AsyncTAPJob.result strictly follows TAP spec result ID requirement #644
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #644 +/- ##
==========================================
+ Coverage 82.30% 82.40% +0.09%
==========================================
Files 72 72
Lines 7430 7438 +8
==========================================
+ Hits 6115 6129 +14
+ Misses 1315 1309 -6 ☔ View full report in Codecov by Sentry. |
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.
While I'm not sure if it's a good idea to have all these odd URIs in public TAP results (could you perhaps do a DAL posting for these? Perhaps you are solving problems other people have?), I am in general in favour of removing compatibility hacks of doubtful value. I am somewhat tempted to quickly see if there are any TAP services out there that need the hack; but then so many async implementations are broken in some way that this would required quite a bit of manual perusal of error messages, so I'll let it pass. I'm sure the more relevant services should do the right thing.
So, in principle, let's go.
A minor nit: The logic in L1015ff is a bit convolved, and I'd feel better if there were test coverage for it. I think doing this would require major scaffolding, but then it's a long time since I last looked at this code. Do you see a simple way to write code that exercises that bit? Or is it a false negative from Codecov in the first place (these are fairly common, unfortunately)?
If it's too hard, let's merge anyway.
Thanks for the feedback! Regarding the URI list, we are using CADC's TAP implementation so I can talk with them for more context, but these are used for getting execution duration for various steps, though I realise most clients will just ignore them. It's likely that we could turn these off and may choose to do so if this is an option. I can do a post on the mailing list this once I have a better idea of the options and background on these. |
On Mon, Jan 27, 2025 at 11:23:53AM -0800, stvoutsin wrote:
and report back (just have to remind myself how to script this to
get the list from Registry).
There, I can help you out from the top of my head:
import pyvo
for rec in pyvo.registry.search(servicetype="tap"):
print(rec.get_service("tap"
).run_sync("select top 1 * from tap_schema.tables"))
|
c58175b
to
974bfae
Compare
e777415
to
42c76e0
Compare
I've added a few tests to hopefully address the changed bits, let me know if I've missed something |
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.
Looks good, and thanks for going the extra mile of checking with the existing services.
Description of Issue
In the process of using
pyvo
with our TAP service at the Rubin Observatory for inspecting job endpoints, I've noticed an issue when usingAsyncTAPJob
to fetch results for a job that does not have a result entry withid="result"
.Sample Snippet:
Sample Job:
Currently this will produce the following output for our case, where we include informative/debugging entries in our results:
DALServiceError: No connection adapters were found for 'uws:executing:10'
This is because it tries to find a result with id="results", and if none are found it will default to the first result entry.
Summary of fix
This PR updates the
AsyncTAPJob.result
method to strictly follow the TAP specification requirement that ADQL query results must have id="result".Per TAP spec section 2.2:
Changes:
Potential Impact:
Testing:
Alternative options
If you think this change is likely to have an impact on non-compliant services that pyvo should continue to support, perhaps there could be an alternative fix I could add to check the existence of the HTTP protocol in the string we get from result_uri.
Feedback welcome on balancing strict compliance vs backwards compatibility.
I can add some tests if this looks like a valid fix for the issue described.