Commit 7813eaa
authored
feat: add display.render_mode to control DataFrame/Series visualization (#2413)
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](https://screenshot.googleplex.com/AHNz4o5Mhb9UHrh)
Fixes #<479282023> 🦕1 parent bf68d0c commit 7813eaa
File tree
8 files changed
+282
-332
lines changed- bigframes/display
- notebooks
- dataframes
- ml
- tests
- system/small
- unit/display
- third_party/bigframes_vendored/pandas/core
8 files changed
+282
-332
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
361 | 361 | | |
362 | 362 | | |
363 | 363 | | |
364 | | - | |
| 364 | + | |
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
0 commit comments