Skip to content

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

Merged
bsipocz merged 1 commit into
astropy:mainfrom
snbianco:content-length-fix
Apr 14, 2025
Merged

Log a warning if a cached file's length cannot be verified#3290
bsipocz merged 1 commit into
astropy:mainfrom
snbianco:content-length-fix

Conversation

@snbianco

@snbianco snbianco commented Apr 14, 2025

Copy link
Copy Markdown
Contributor

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 bsipocz and keflavich April 14, 2025 19:22
@snbianco snbianco marked this pull request as ready for review April 14, 2025 19:25
@codecov

codecov Bot commented Apr 14, 2025

Copy link
Copy Markdown

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

@keflavich keflavich left a comment

Copy link
Copy Markdown
Contributor

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!)

@bsipocz bsipocz left a comment

Copy link
Copy Markdown
Member

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
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