Skip to content

Commit 7b87d2a

Browse files
committed
fix mypy
1 parent f9bac38 commit 7b87d2a

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

bigframes/display/anywidget.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,17 @@ def __init__(self, dataframe: bigframes.dataframe.DataFrame):
136136
self.row_count = self._batches.total_rows
137137

138138
# get the initial page
139-
self._get_next_batch()
140139
self._set_table_html()
141140

142141
# Signals to the frontend that the initial data load is complete.
143142
# Also used as a guard to prevent observers from firing during initialization.
144143
self._initial_load_complete = True
145144

145+
@traitlets.observe("_initial_load_complete")
146+
def _on_initial_load_complete(self, change: Dict[str, Any]):
147+
if change["new"]:
148+
self._set_table_html()
149+
146150
@functools.cached_property
147151
def _esm(self):
148152
"""Load JavaScript code from external file."""

notebooks/dataframes/anywidget_mode.ipynb

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@
157157
{
158158
"data": {
159159
"application/vnd.jupyter.widget-view+json": {
160-
"model_id": "3ad3ce907f4d43de8c3c15f0d1cdebd6",
160+
"model_id": "2935e3f8f4f34c558d588f09a9c42131",
161161
"version_major": 2,
162162
"version_minor": 1
163163
},
@@ -255,7 +255,7 @@
255255
{
256256
"data": {
257257
"application/vnd.jupyter.widget-view+json": {
258-
"model_id": "684becdc45de4a15826672c0a7e89930",
258+
"model_id": "fa03d998dfee47638a32b6c21ace0b5c",
259259
"version_major": 2,
260260
"version_minor": 1
261261
},
@@ -369,7 +369,7 @@
369369
{
370370
"data": {
371371
"application/vnd.jupyter.widget-view+json": {
372-
"model_id": "5cccf9eb2a674f9f8a1bdb165921d5f9",
372+
"model_id": "6d6886bd2bb74be996d54ce240cbe6c9",
373373
"version_major": 2,
374374
"version_minor": 1
375375
},
@@ -401,15 +401,15 @@
401401
},
402402
{
403403
"cell_type": "code",
404-
"execution_count": 10,
404+
"execution_count": 11,
405405
"id": "added-cell-1",
406406
"metadata": {},
407407
"outputs": [
408408
{
409409
"data": {
410410
"text/html": [
411411
"✅ Completed. \n",
412-
" Query processed 85.9 kB in 13 seconds of slot time.\n",
412+
" Query processed 85.9 kB in 24 seconds of slot time.\n",
413413
" "
414414
],
415415
"text/plain": [
@@ -456,7 +456,7 @@
456456
{
457457
"data": {
458458
"application/vnd.jupyter.widget-view+json": {
459-
"model_id": "06e704906f254de194e5e3ea1ef2bdbb",
459+
"model_id": "df774329fd2f47918b986362863d7155",
460460
"version_major": 2,
461461
"version_minor": 1
462462
},
@@ -474,7 +474,7 @@
474474
"Computation deferred. Computation will process 0 Bytes"
475475
]
476476
},
477-
"execution_count": 10,
477+
"execution_count": 11,
478478
"metadata": {},
479479
"output_type": "execute_result"
480480
}

0 commit comments

Comments
 (0)