Skip to content

Commit a7b0eed

Browse files
authored
TqdmCallback: fix typo/off-by-one error (#277)
`self.tqdm` should be set if progress_bar is passed.
1 parent 542f604 commit a7b0eed

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/dvc_objects/fs/callbacks.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,10 @@ def __init__(
4141
from dvc_objects._tqdm import Tqdm
4242

4343
tqdm_kwargs.pop("total", None)
44-
tqdm_cls = tqdm_cls or Tqdm
4544
super().__init__(
46-
tqdm_kwargs=tqdm_kwargs, tqdm_cls=tqdm_cls, size=size, value=value
45+
tqdm_kwargs=tqdm_kwargs, tqdm_cls=tqdm_cls or Tqdm, size=size, value=value
4746
)
48-
if progress_bar is None:
47+
if progress_bar is not None:
4948
self.tqdm = progress_bar
5049

5150
def branched(self, path_1: "Union[str, BinaryIO]", path_2: str, **kwargs):

0 commit comments

Comments
 (0)