-
-
Notifications
You must be signed in to change notification settings - Fork 410
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
un-indenting head-safe check to apply for cached files too #3232
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3232 +/- ##
==========================================
+ Coverage 69.08% 69.32% +0.23%
==========================================
Files 232 232
Lines 19592 19661 +69
==========================================
+ Hits 13536 13630 +94
+ Misses 6056 6031 -25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Hi again @eas342, thanks for this PR! This change is to a file in the main Astroquery directory and not part of any particular module, so it will impact more than just the MAST module. I would rather we change the MAST module directly so that it knows to continue incomplete file downloads. See my comment on the issue here: #3231 (comment) |
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.
See other comment!
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.
Unindenting this block is not the correct behavior; it will overwrite the continuation
block above, which would result in the download continuation failing - it will download the whole file and append it to whatever was partly completed.
However, this same code block (the if head_safe: response = request(...)
block) needs to be repeated above, in the other location open_mode='wb'
Thank you @keflavich , Unfortunately, the change you made does not seem to pass #3231
WARNING: Found cached file jw01185103001_02102_00001-seg001_nrcalong_rate.fits with size 0 that is different from expected size 83520 [astroquery.query] |
continuation was set to False (which is the case - MAST hard-codes that), no download was being done - we were only retrieving the header, not the data
Thanks @eas342. Indeed, there was another corner case we hadn't checked. The latest commit catches it. |
That works, super! Thank you @keflavich |
@eas342 @keflavich - I'm not sure how to test this in CI, etc. But if you are certain it covers all the cases, and add a changelog, it can still go in the next release ~tomorrow. |
let's add tests; i think i can turn @eas342 's mwe into a test easily enough. so delay merging |
…ant to review it on github & see what coverage bot says
…ot sure things are right any more...
… redundant checks, and there seems to be no reason to return None
@bsipocz this is ready for final review |
Un-indenting the head-safe boolean check to apply to both fixing incomplete cached files and new files. This appears to fix this issue:
#3231
However, I do not understand what this
head_safe
keyword does, so please check that this does not break the intended functionality or flow.