Skip to content

Commit 0b51efe

Browse files
committed
Revert "fix: SQL cell output broken in Colab due to anywidget HTML conflict"
This reverts commit 8ba60a1.
1 parent a183d52 commit 0b51efe

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

bigframes/dataframe.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,11 @@ def _get_anywidget_bundle(self, include=None, exclude=None):
864864
else:
865865
widget_repr = dict(widget_repr_result)
866866

867-
# Plain text representations to avoid multiple queries.
867+
# At this point, we have already executed the query as part of the
868+
# widget construction. Let's use the information available to render
869+
# the HTML and plain text versions.
870+
widget_repr["text/html"] = widget.table_html
871+
868872
widget_repr["text/plain"] = self._create_text_representation(
869873
widget._cached_data, widget.row_count
870874
)

tests/system/small/test_anywidget.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -930,19 +930,6 @@ def test_repr_in_anywidget_mode_should_not_be_deferred(
930930
assert "page_1_row_1" in representation
931931

932932

933-
def test_repr_mimebundle_anywidget_no_html(
934-
paginated_bf_df: bf.dataframe.DataFrame,
935-
):
936-
"""
937-
Verify that in 'anywidget' mode, the mimebundle does not contain 'text/html'.
938-
This is to prevent rendering conflicts in environments like Colab.
939-
"""
940-
with bf.option_context("display.repr_mode", "anywidget"):
941-
mimebundle = paginated_bf_df._repr_mimebundle_()
942-
assert "text/html" not in mimebundle
943-
assert "application/vnd.jupyter.widget-view+json" in mimebundle
944-
945-
946933
# TODO(b/332316283): Add tests for custom index and multiindex
947934
# This may not be necessary for the SQL Cell use case but should be
948935
# considered for completeness.

0 commit comments

Comments
 (0)