You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.rst
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -110,6 +110,19 @@ For details, see the `third_party
110
110
directory.
111
111
112
112
113
+
Display Enhancements
114
+
--------------------
115
+
116
+
**DataFrame `_repr_html_()` and `_ipython_display_()` Integration**
117
+
118
+
The `bigframes.pandas.DataFrame._repr_html_()` method has been updated. When `bpd.options.display.repr_mode` is set to “anywidget”, it will:
119
+
120
+
* Wrap the import of `anywidget` in a `try...except ImportError` block. If the dependency is not found, it will issue a `warnings.warn` message and fall back to returning the deferred representation.
121
+
* If the import is successful, it instantiates a new `TableWidget`, passing the DataFrame's data.
122
+
* Return the widget instance, which Jupyter automatically renders. A new widget instance is created for each `_repr_html_()` call to ensure cell outputs are isolated.
123
+
124
+
A new `_ipython_display_()` method has been introduced to handle the actual widget rendering, separating concerns from `_repr_html_()`.
Copy file name to clipboardExpand all lines: notebooks/dataframes/anywidget_mode.ipynb
+9-22Lines changed: 9 additions & 22 deletions
Original file line number
Diff line number
Diff line change
@@ -36,6 +36,7 @@
36
36
"id": "ca22f059",
37
37
"metadata": {},
38
38
"outputs": [],
39
+
"outputs": [],
39
40
"source": [
40
41
"import bigframes.pandas as bpd"
41
42
]
@@ -143,6 +144,7 @@
143
144
"data": {
144
145
"application/vnd.jupyter.widget-view+json": {
145
146
"model_id": "8fcad7b7e408422cae71d519cd2d4980",
147
+
"model_id": "4cc789c49be246bb94967e625986900a",
146
148
"version_major": 2,
147
149
"version_minor": 1
148
150
},
@@ -152,17 +154,6 @@
152
154
},
153
155
"metadata": {},
154
156
"output_type": "display_data"
155
-
},
156
-
{
157
-
"data": {
158
-
"text/html": [],
159
-
"text/plain": [
160
-
"Computation deferred. Computation will process 171.4 MB"
161
-
]
162
-
},
163
-
"execution_count": 6,
164
-
"metadata": {},
165
-
"output_type": "execute_result"
166
157
}
167
158
],
168
159
"source": [
@@ -206,6 +197,7 @@
206
197
"data": {
207
198
"application/vnd.jupyter.widget-view+json": {
208
199
"model_id": "06cb98c577514d5c9654a7792d93f8e6",
200
+
"model_id": "b1089664ce03440d81ef206da1210229",
209
201
"version_major": 2,
210
202
"version_minor": 1
211
203
},
@@ -284,6 +276,8 @@
284
276
{
285
277
"data": {
286
278
"text/html": [
279
+
"✅ Completed. \n",
280
+
" Query processed 171.4 MB in a moment of slot time.\n",
287
281
"✅ Completed. \n",
288
282
" Query processed 171.4 MB in a moment of slot time.\n",
289
283
""
@@ -306,6 +300,7 @@
306
300
"data": {
307
301
"application/vnd.jupyter.widget-view+json": {
308
302
"model_id": "1672f826f7a347e38539dbb5fb72cd43",
303
+
"model_id": "f18925fc13304fb2ae34056f2cb1c68b",
309
304
"version_major": 2,
310
305
"version_minor": 1
311
306
},
@@ -346,6 +341,7 @@
346
341
"text/html": [
347
342
"✅ Completed. \n",
348
343
" Query processed 85.9 kB in 12 seconds of slot time.\n",
344
+
" Query processed 85.9 kB in 15 seconds of slot time.\n",
349
345
""
350
346
],
351
347
"text/plain": [
@@ -359,6 +355,7 @@
359
355
"name": "stderr",
360
356
"output_type": "stream",
361
357
"text": [
358
+
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/dtypes.py:987: JSONDtypeWarning: JSON columns will be represented as pandas.ArrowDtype(pyarrow.json_())\n",
362
359
"/usr/local/google/home/shuowei/src/python-bigquery-dataframes/bigframes/dtypes.py:987: JSONDtypeWarning: JSON columns will be represented as pandas.ArrowDtype(pyarrow.json_())\n",
363
360
"instead of using `db_dtypes` in the future when available in pandas\n",
364
361
"(https://github.com/pandas-dev/pandas/issues/60958) and pyarrow.\n",
@@ -381,6 +378,7 @@
381
378
"data": {
382
379
"application/vnd.jupyter.widget-view+json": {
383
380
"model_id": "127a2e356b834c18b6f07c58ee2c4228",
381
+
"model_id": "2335d3161b704a6da85165dbebf5ca0f",
384
382
"version_major": 2,
385
383
"version_minor": 1
386
384
},
@@ -390,17 +388,6 @@
390
388
},
391
389
"metadata": {},
392
390
"output_type": "display_data"
393
-
},
394
-
{
395
-
"data": {
396
-
"text/html": [],
397
-
"text/plain": [
398
-
"Computation deferred. Computation will process 0 Bytes"
0 commit comments