Skip to content

Commit

Permalink
Auto-detect progressbar type
Browse files Browse the repository at this point in the history
Use tqdm.auto to get a progressbar appropriate to the environment
(e.g tqdm.notebook.tqdm for Jupyter Notebook). Falls back to standard
tqdm.tqdm if an ImportError is encountered (as described in tqdm/tqdm#1082)
  • Loading branch information
duckontheweb committed Feb 8, 2021
1 parent 8be066b commit 88f9d55
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion radiant_mlhub/client.py
Expand Up @@ -8,7 +8,12 @@
import urllib.parse

from requests.exceptions import HTTPError
from tqdm import tqdm

try:
from tqdm.auto import tqdm
except ImportError: # pragma: no cover
# Handles this issue: https://github.com/tqdm/tqdm/issues/1082
from tqdm import tqdm # type: ignore [no-redef]

from .session import get_session
from .exceptions import EntityDoesNotExist, MLHubException
Expand Down

0 comments on commit 88f9d55

Please sign in to comment.