Skip to content

Conversation

@shuoweil
Copy link
Contributor

@shuoweil shuoweil commented Jan 28, 2026

This PR introduces a new configuration option, bigframes.options.display.render_mode, to explicitly control how DataFrames and Series are visualized in Jupyter environments. This change decouples the visualization logic from the execution strategy defined by repr_mode.

Key Changes:

  • New render_mode option: Added with three supported values:
    • "html" (default): Renders a static HTML table, preserving the existing default behavior.
    • "anywidget": Enables the interactive TableWidget with sorting and pagination.
    • "plaintext": Forces a plain text string representation even in rich environments.
  • Preserved repr_mode behavior: repr_mode remains focused on execution strategy ("head" vs "deferred"). Decoupling these ensures that "head" execution can be paired with any visualization style.
  • Updated Selection Logic: The repr_mimebundle implementation now respects the render_mode flag to determine which formats to include in the Jupyter output.
  • Robust Testing: Added unit tests to verify the selection logic and updated existing system tests to handle tuple-based MIME bundle returns.

Users will see no change in default behavior (Immediate execution + static HTML). However, they now have a clean mechanism to opt-in to the interactive Anywidget experience or force plaintext output by setting bigframes.options.display.render_mode.

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
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