Skip to content

Log a warning if a cached file's length cannot be verified #3290

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

Merged
merged 1 commit into from
Apr 14, 2025

Conversation

snbianco
Copy link
Contributor

@snbianco snbianco commented Apr 14, 2025

See this discussion.

Rather than raise an error when a cached file's length cannot be verified, warn the user and re-download the file. This is needed for certain files in the MAST Archive that are generated dynamically and don't include a Content-Length header in their response at this time.

My understanding was that this could not be tested in test_query.py, but I did add a case in the MAST module tests.

@snbianco snbianco requested review from keflavich and bsipocz April 14, 2025 19:22
@snbianco snbianco marked this pull request as ready for review April 14, 2025 19:25
Copy link

codecov bot commented Apr 14, 2025

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 69.36%. Comparing base (4c2caa2) to head (4ed16e4).
Report is 168 commits behind head on main.

Files with missing lines Patch % Lines
astroquery/query.py 0.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3290      +/-   ##
==========================================
- Coverage   69.37%   69.36%   -0.02%     
==========================================
  Files         232      232              
  Lines       19689    19692       +3     
==========================================
  Hits        13659    13659              
- Misses       6030     6033       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@bsipocz bsipocz added the mast label Apr 14, 2025
@bsipocz bsipocz added this to the v0.4.11 milestone Apr 14, 2025
Copy link
Contributor

@keflavich keflavich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks for implementing this (and the test!)

Copy link
Member

@bsipocz bsipocz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@bsipocz bsipocz merged commit 1ebd810 into astropy:main Apr 14, 2025
11 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants