Skip to content

feat: Disable progress bars in Anywidget mode#2444

Merged
tswast merged 11 commits intomainfrom
shuowei-anywidget-disable-log
Feb 6, 2026
Merged

feat: Disable progress bars in Anywidget mode#2444
tswast merged 11 commits intomainfrom
shuowei-anywidget-disable-log

Conversation

@shuoweil
Copy link
Contributor

@shuoweil shuoweil commented Feb 6, 2026

This PR improves the user experience of the interactive Anywidget display mode by automatically disabling progress bars and job logging during widget operations.

Changes:

Wrapped the get_anywidget_bundle call in repr_mimebundle with option_context("display.progress_bar", None) to silence the initial widget load.
Wrapped TableWidget._initial_load and TableWidget._set_table_html methods to silence subsequent interactions like pagination and sorting.
Motivation:
When interacting with the TableWidget (paging, sorting), the repeated appearance of progress bars creates visual noise and clutter in the notebook output cell, distracting from the interactive data exploration experience. This change ensures a clean and seamless interface.

Verified at:

vs code notebook: screen/B7hCnXdLeTiFshr
colab notebook: screen/4d8Kpo5ZbbfZUBb

Fixes #< 482120359 > 🦕

@shuoweil shuoweil requested review from a team as code owners February 6, 2026 20:31
@shuoweil shuoweil requested a review from sycai February 6, 2026 20:31
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@product-auto-label product-auto-label bot added the size: l Pull request size is large. label Feb 6, 2026
@product-auto-label product-auto-label bot added the api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. label Feb 6, 2026
@shuoweil shuoweil assigned shuoweil and unassigned shobsi Feb 6, 2026
Comment on lines 366 to 367
with bigframes.option_context("display.progress_bar", None):
return get_anywidget_bundle(obj, include=include, exclude=exclude)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this doing that isn't already covered by your changes in bigframes/display/anywidget.py ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, the context manager in html.py is redundant. I've removed it and ensured that TableWidget handles hiding the progress bar for all its data-fetching operations, including initial load and subsequent updates (e.g. when changing page size).

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These changes seem unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I have removed all unrelated change.

@product-auto-label product-auto-label bot added size: s Pull request size is small. and removed size: l Pull request size is large. labels Feb 6, 2026
@shuoweil shuoweil requested a review from tswast February 6, 2026 21:03
@tswast tswast enabled auto-merge (squash) February 6, 2026 21:21
@shuoweil shuoweil force-pushed the shuowei-anywidget-disable-log branch from 2bb285f to 9cdd052 Compare February 6, 2026 22:36
@tswast tswast merged commit 4e2689a into main Feb 6, 2026
19 of 24 checks passed
@tswast tswast deleted the shuowei-anywidget-disable-log branch February 6, 2026 23:51
shuoweil added a commit that referenced this pull request Feb 7, 2026
PR created by the Librarian CLI to initialize a release. Merging this PR
will auto trigger a release.

Librarian Version: v0.7.0
Language Image:
us-central1-docker.pkg.dev/cloud-sdk-librarian-prod/images-prod/python-librarian-generator@sha256:e7cc6823efb073a8a26e7cefdd869f12ec228abfbd2a44aa9a7eacc284023677
<details><summary>bigframes: 2.35.0</summary>

##
[2.35.0](v2.34.0...v2.35.0)
(2026-02-07)

### Features

* Add bigframes.pandas.col with basic operators (#2405)
([1274167](12741677))

* remove redundant &#34;started.&#34; messages from progress output
(#2440)
([2017cc2](2017cc2f))

* add bigframe.bigquery.load_data function (#2426)
([4b0f13b](4b0f13b2))

* Disable progress bars in Anywidget mode (#2444)
([4e2689a](4e2689a1))

* add bigquery.ai.generate_text function (#2433)
([5bd0029](5bd0029a))

* Disable progress bars in Anywidget mode to reduce notebook clutter
(#2437)
([853240d](853240da))

* Add a bigframes cell magic for ipython (#2395)
([e6de52d](e6de52de))

* add `bigframes.bigquery.ai.generate_embedding` (#2343)
([e91536c](e91536c8))

### Bug Fixes

* always display the results in the `%%bqsql` cell magics output (#2439)
([2d973b5](2d973b54))

* exlcude gcsfs 2026.2.0 (#2445)
([311de31](311de31e))

* suppress JSONDtypeWarning in Anywidget mode and clean up progress
output (#2441)
([e0d185a](e0d185ad))

### Documentation

* fix cast method shown on public docs (#2436)
([ad0f33c](ad0f33c6))

</details>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. size: s Pull request size is small.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants