Skip to content

Commit

Permalink
callback: guard against None values (#441)
Browse files Browse the repository at this point in the history
See Azure/azure-sdk-for-python#11419 (comment) on how to get
progress information.
Also related: #275 (comment) and iterative/dvc#7704.

Invalid values should not be passed to callbacks.
  • Loading branch information
skshetry committed Dec 23, 2023
1 parent f9f4013 commit f80d0af
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion adlfs/spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ def wrapper(response):

current = response.context.get(key)
total = response.context["data_stream_total"]
if not sent_total:
if current is None:
return
if not sent_total and total is not None:
callback.set_size(total)
callback.absolute_update(current)

Expand Down

0 comments on commit f80d0af

Please sign in to comment.