Skip to content

Comments

feat: add display.render_mode to control DataFrame/Series visualization#2413

Open
shuoweil wants to merge 15 commits intomainfrom
shuowei-anywidget-cell-visual
Open

feat: add display.render_mode to control DataFrame/Series visualization#2413
shuoweil wants to merge 15 commits intomainfrom
shuowei-anywidget-cell-visual

Conversation

@shuoweil
Copy link
Contributor

@shuoweil shuoweil commented Jan 28, 2026

This PR introduces the display.render_mode configuration option, providing a clearer and more flexible way to control how BigFrames objects are visualized in notebooks and other interactive environments.

Key Changes:

  • New Configuration Option: Added bpd.options.display.render_mode which supports three modes:
    • html (Default): Standard HTML table rendering.
    • plaintext: Forces plain text output by removing the HTML component from the mimebundle.
    • anywidget: Enables the interactive anywidget-based table component.
  • Migration Path: Maintained backward compatibility for display.repr_mode = "anywidget". The rendering logic now checks both the new render_mode and the legacy repr_mode flags.
  • Notebook & Test Updates: Updated existing notebooks and system tests to prefer the new render_mode option while verifying that existing behaviors remain intact.
  • New Unit Tests: Added tests/unit/display/test_render_mode.py to specifically verify the mimebundle selection logic and priority across different configuration states.

While repr_mode was previously used to toggle the interactive widget, "representation mode" is a broad term. render_mode specifically addresses the format of the output (HTML vs. Text vs. Widget), allowing for better support for text-only environments and a more intuitive API for users.

Also verified at colab notebook: screen/AHNz4o5Mhb9UHrh

Fixes #<479282023> 🦕

@shuoweil shuoweil self-assigned this Jan 28, 2026
@shuoweil shuoweil requested review from a team as code owners January 28, 2026 22:59
@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 size: m Pull request size is medium. api: bigquery Issues related to the googleapis/python-bigquery-dataframes API. labels Jan 28, 2026
@shuoweil shuoweil marked this pull request as draft January 29, 2026 00:20
@shuoweil shuoweil marked this pull request as ready for review January 30, 2026 00:26
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Jan 30, 2026
@shuoweil shuoweil marked this pull request as draft February 2, 2026 21:00
@shuoweil shuoweil force-pushed the shuowei-anywidget-cell-visual branch from c20f0ae to 60359f8 Compare February 21, 2026 00:14
@shuoweil shuoweil removed the request for review from a team February 21, 2026 00:26
@shuoweil shuoweil changed the title feat: Add display.render_mode option to control DataFrame visualization feat: add display.render_mode to control DataFrame/Series visualization Feb 21, 2026
@shuoweil shuoweil marked this pull request as ready for review February 21, 2026 00:28
@shuoweil shuoweil requested a review from a team as a code owner February 21, 2026 00:28
@shuoweil
Copy link
Contributor Author

Upon checking, the failed tests are unrelated to our change.

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: l Pull request size is large.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant