-
Notifications
You must be signed in to change notification settings - Fork 304
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
feat: add progress bar for magics #396
Conversation
@@ -182,6 +182,7 @@ def __init__(self): | |||
self._default_query_job_config = bigquery.QueryJobConfig() | |||
self._bigquery_client_options = client_options.ClientOptions() | |||
self._bqstorage_client_options = client_options.ClientOptions() | |||
self._progress_bar_type = None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think tqdm
would be fine default value here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If i put tqdm
as a default value anywhere in the code, test_jupyter_tutorial(ipython)
snippet failed, you can see in the first commit. It's because tqdm
is not installed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's because there's a bug in the progress bar code.
if progress_bar_type is None:
return query_job.result()
This is too soon to check if a progress bar can be supported. We should check if progress_bar is None
after
progress_bar = get_progress_bar(
progress_bar_type, "Query is running", default_total, "query"
)
Something like
"""Return query result and display a progress bar while the query running, if tqdm is installed."""
progress_bar = get_progress_bar(
progress_bar_type, "Query is running", default_total, "query"
)
if progress_bar is None:
return query_job.result()
default_total = 1
current_stage = None
start_time = time.time()
Fixes #389