Skip to content
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

Do fail (raise Exception, should be non-0 exit) download if any download fails #1536

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

yarikoptic
Copy link
Member

Sits on top of #1535

  • ensure that CLI experience is ok and we do get non-0 exit
  • fixup tests

…tempts_allowed

no functionality changes should be done.

Also removed some stale TODO comments -- DownloadDirectory already downloads
into a file with ".dandidownload" instead of original filename. And we do
report progress. ETA should be estimated outside IMHO.
Otherwise it is hard-to-impossible to script using "dandi download" reliably
if resuming:
lgr.debug("%s - resumed download. Need to check full checksum.", path)
else:
assert not downloaded_digest

Check warning

Code scanning / CodeQL

Unreachable code Warning

This statement is unreachable.
Comment on lines +1040 to +1046
def _check_if_more_attempts_allowed(
path: Path,
exc: requests.RequestException,
attempt: int,
attempts_allowed: int,
downloaded_in_attempt: int,
) -> int | None:

Check notice

Code scanning / CodeQL

Explicit returns mixed with implicit (fall through) returns Note

Mixing implicit and explicit returns may indicate an error as implicit returns always return None.
Comment on lines +1106 to +1107
# if is_access_denied(exc) or attempt >= 2:
# raise

Check notice

Code scanning / CodeQL

Commented-out code Note

This comment appears to contain commented-out code.
Copy link

codecov bot commented Nov 23, 2024

Codecov Report

Attention: Patch coverage is 54.09836% with 28 lines in your changes missing coverage. Please review.

Project coverage is 88.55%. Comparing base (fd3f5e6) to head (09dcf7a).
Report is 2 commits behind head on master.

Files with missing lines Patch % Lines
dandi/download.py 39.13% 28 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1536      +/-   ##
==========================================
+ Coverage   88.44%   88.55%   +0.10%     
==========================================
  Files          78       78              
  Lines       10691    10721      +30     
==========================================
+ Hits         9456     9494      +38     
+ Misses       1235     1227       -8     
Flag Coverage Δ
unittests 88.55% <54.09%> (+0.10%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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


🚨 Try these New Features:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant