Skip to content

show progress bar in %%bigquery magics #389

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

Closed
tswast opened this issue Nov 16, 2020 · 4 comments · Fixed by #396
Closed

show progress bar in %%bigquery magics #389

tswast opened this issue Nov 16, 2020 · 4 comments · Fixed by #396
Assignees
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@tswast
Copy link
Contributor

tswast commented Nov 16, 2020

Is your feature request related to a problem? Please describe.

When running the %%bigquery magics, there is no indication of progress.

Describe the solution you'd like

Show a progress bar using tqdm or tqdm_notebook.

Describe alternatives you've considered

N/A

Additional context

tqdm_notebook is ideal, as it uses the ability to embed HTML for a nicer-looking progress bar, but this is not always available. tqdm should be the default, but perhaps overridable via the google.cloud.bigquery.magics.context settings.

@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery API. label Nov 16, 2020
@tswast tswast added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. and removed api: bigquery Issues related to the googleapis/python-bigquery API. labels Nov 16, 2020
@tswast
Copy link
Contributor Author

tswast commented Nov 16, 2020

This may be as simple as setting progress_bar_type="tqdm" here:

bqstorage_client=bqstorage_client
and here:
result = query_job.to_dataframe(bqstorage_client=bqstorage_client)

but ideally we would want the ability to change to tqdm_notebook when explicitly requested or maybe even if we can detect that we are in a supported environment

@tswast
Copy link
Contributor Author

tswast commented Nov 16, 2020

Follow-up to #343 which added the progress bar for waiting for the query to finish.

@HemangChothani HemangChothani self-assigned this Nov 19, 2020
@HemangChothani
Copy link
Contributor

  • Can we use get_ipython().__class__ to detect terminal or any other notebooks and set the progress_bar_type accordingly?

  • Can we include progress_bar_type parameter in to the magic_arguments and set default to 'tqdm'?

@tswast
Copy link
Contributor Author

tswast commented Nov 19, 2020

Can we include progress_bar_type parameter in to the magic_arguments and set default to 'tqdm'?

Let's start with this. Plus, let's add progress_bar_type to the global context object so that the default can be changed by the user.

Can we use get_ipython().class to detect terminal or any other notebooks and set the progress_bar_type accordingly?

Let's file a separate issue for that. I don't want to get too magic in our magics. :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants