Skip to content

Commit f80d0af

Browse files
authored
callback: guard against None values (#441)
See Azure/azure-sdk-for-python#11419 (comment) on how to get progress information. Also related: #275 (comment) and treeverse/dvc#7704. Invalid values should not be passed to callbacks.
1 parent f9f4013 commit f80d0af

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

adlfs/spec.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ def wrapper(response):
8282

8383
current = response.context.get(key)
8484
total = response.context["data_stream_total"]
85-
if not sent_total:
85+
if current is None:
86+
return
87+
if not sent_total and total is not None:
8688
callback.set_size(total)
8789
callback.absolute_update(current)
8890

0 commit comments

Comments
 (0)