-
-
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
Make TAP job deletion optional defaulting to True #640
Conversation
pyvo/dal/tap.py
Outdated
if self._delete_on_exit: | ||
try: | ||
self.delete() | ||
except Exception: |
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.
This may point beyond the PR, but while we're at it, maybe use a more specific exception here rather than a blanket one?
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #640 +/- ##
==========================================
- Coverage 82.30% 82.30% -0.01%
==========================================
Files 72 72
Lines 7427 7430 +3
==========================================
+ Hits 6113 6115 +2
- Misses 1314 1315 +1 ☔ 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.
This needs a changelog entry otherwise looks good to me.
(Test failures in the remote job are not related)
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.
It looks good to me. Just needs a CHANGE log entry and make sure tests pass.
Thanks for the review. I've added a changelog entry, I also noticed the code-coverage message, happy to add some tests as well if you think they would be useful here. |
I'm not sure how to meaningfully cover this with tests, so I would say this is ready to go, pending a small fix to the changelog. Thanks @stvoutsin! (ps Adrian: the test failures are unrelated) |
Motivation for change
We have a requirement for the Rubin Observatory TAP services to maintain and provide history of queries run through the TAP service, for which we plan on utilizing the UWS jobs list. However, since many of our users will be querying our services via pyvo, query jobs will be deleted by default after being run as it currently stands.
PR Summary
This PR adds a
delete
parameter to control whether TAP jobs are automatically deleted after completion.By default, jobs are still deleted (to maintain backward compatibility), but users can now set
delete=False
to keep jobs.
Changes
delete
parameter torun_async
method in TAPServicedelete
parameter to AsyncTAPJob context managerExample usage