This repository was archived by the owner on May 7, 2026. It is now read-only.
Commit 508deae
authored
fix: Improve Anywidget pagination and display for unknown row counts (#2258)
Previously, when the total number of rows (row_count) was unknown (e.g.,
due to deferred computation or errors), it would incorrectly default to
0. This resulted in confusing UI, such as displaying "Page 1 of 0", and
allowed users to navigate to empty pages without automatically returning
to valid data.
current display strategy for the interactive table widget:
* When `row_count` is a positive number (e.g., 50):
* Total Rows Display: Shows the exact count, like 50 total rows.
* Pagination Display: Shows the page relative to the total rows, like
Page 1 of 50.
* Navigation: The "Next" button is disabled only on the final page.
* When `row_count` is `None` (unknown):
* Total Rows Display: Shows Total rows unknown.
* Pagination Display: Shows the page relative to an unknown total, like
Page 1 of many.
* Navigation: The "Next" button is always enabled, allowing you to page
forward until the backend determines there is no more data.
Fixes #<428238610> 🦕1 parent 7c062a6 commit 508deaeCopy full SHA for 508deae
4 files changed
+310-72Lines changed: 310 additions & 72 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- bigframes/display
- notebooks/dataframes
- tests/system/small
Expand file treeCollapse file tree
Open diff view settings
Collapse file
bigframes/display/anywidget.py
Copy file name to clipboardExpand all lines: bigframes/display/anywidget.py+44-7Lines changed: 44 additions & 7 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
55 | 55 | |
56 | 56 | |
57 | 57 | |
58 | | - |
| 58 | + |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + |
59 | 63 | |
60 | 64 | |
61 | 65 | |
| ||
94 | 98 | |
95 | 99 | |
96 | 100 | |
97 | | - |
98 | | - |
99 | 101 | |
100 | | - |
101 | | - |
102 | | - |
| 102 | + |
| 103 | + |
| 104 | + |
| 105 | + |
| 106 | + |
| 107 | + |
| 108 | + |
| 109 | + |
| 110 | + |
| 111 | + |
103 | 112 | |
104 | 113 | |
105 | 114 | |
| ||
131 | 140 | |
132 | 141 | |
133 | 142 | |
134 | | - |
135 | 143 | |
| 144 | + |
| 145 | + |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | + |
| 150 | + |
136 | 151 | |
137 | 152 | |
138 | 153 | |
| 154 | + |
| 155 | + |
| 156 | + |
| 157 | + |
| 158 | + |
139 | 159 | |
140 | 160 | |
141 | 161 | |
| ||
229 | 249 | |
230 | 250 | |
231 | 251 | |
| 252 | + |
| 253 | + |
| 254 | + |
| 255 | + |
| 256 | + |
| 257 | + |
| 258 | + |
| 259 | + |
| 260 | + |
| 261 | + |
| 262 | + |
| 263 | + |
| 264 | + |
| 265 | + |
| 266 | + |
| 267 | + |
| 268 | + |
232 | 269 | |
233 | 270 | |
234 | 271 | |
|
Collapse file
bigframes/display/table_widget.js
Copy file name to clipboardExpand all lines: bigframes/display/table_widget.js+15-8Lines changed: 15 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
85 | 85 | |
86 | 86 | |
87 | 87 | |
88 | | - |
89 | | - |
90 | | - |
91 | | - |
92 | | - |
93 | | - |
94 | | - |
95 | | - |
| 88 | + |
| 89 | + |
| 90 | + |
| 91 | + |
| 92 | + |
| 93 | + |
| 94 | + |
| 95 | + |
| 96 | + |
| 97 | + |
| 98 | + |
| 99 | + |
| 100 | + |
| 101 | + |
| 102 | + |
96 | 103 | |
97 | 104 | |
98 | 105 | |
|
Collapse file
notebooks/dataframes/anywidget_mode.ipynb
Copy file name to clipboardExpand all lines: notebooks/dataframes/anywidget_mode.ipynb+97-38Lines changed: 97 additions & 38 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
35 | 35 | |
36 | 36 | |
37 | 37 | |
38 | | - |
39 | | - |
40 | | - |
41 | | - |
42 | | - |
43 | | - |
44 | | - |
45 | | - |
46 | | - |
47 | | - |
| 38 | + |
48 | 39 | |
49 | 40 | |
50 | 41 | |
| ||
151 | 142 | |
152 | 143 | |
153 | 144 | |
154 | | - |
| 145 | + |
155 | 146 | |
156 | 147 | |
157 | 148 | |
| ||
175 | 166 | |
176 | 167 | |
177 | 168 | |
178 | | - |
| 169 | + |
179 | 170 | |
180 | 171 | |
181 | 172 | |
| ||
214 | 205 | |
215 | 206 | |
216 | 207 | |
217 | | - |
| 208 | + |
218 | 209 | |
219 | 210 | |
220 | 211 | |
| ||
293 | 284 | |
294 | 285 | |
295 | 286 | |
296 | | - |
297 | | - |
298 | | - |
299 | | - |
300 | | - |
301 | | - |
302 | | - |
303 | | - |
304 | | - |
305 | | - |
306 | | - |
307 | | - |
308 | | - |
309 | | - |
310 | | - |
311 | | - |
312 | | - |
313 | | - |
314 | | - |
315 | | - |
316 | | - |
| 287 | + |
| 288 | + |
317 | 289 | |
318 | 290 | |
319 | 291 | |
| ||
333 | 305 | |
334 | 306 | |
335 | 307 | |
336 | | - |
| 308 | + |
337 | 309 | |
338 | 310 | |
339 | 311 | |
| ||
373 | 345 | |
374 | 346 | |
375 | 347 | |
376 | | - |
| 348 | + |
377 | 349 | |
378 | 350 | |
379 | 351 | |
| ||
387 | 359 | |
388 | 360 | |
389 | 361 | |
390 | | - |
| 362 | + |
391 | 363 | |
392 | 364 | |
393 | 365 | |
| ||
408 | 380 | |
409 | 381 | |
410 | 382 | |
411 | | - |
| 383 | + |
412 | 384 | |
413 | 385 | |
414 | 386 | |
| ||
443 | 415 | |
444 | 416 | |
445 | 417 | |
| 418 | + |
| 419 | + |
| 420 | + |
| 421 | + |
| 422 | + |
| 423 | + |
| 424 | + |
| 425 | + |
| 426 | + |
| 427 | + |
| 428 | + |
| 429 | + |
| 430 | + |
| 431 | + |
| 432 | + |
| 433 | + |
| 434 | + |
| 435 | + |
| 436 | + |
| 437 | + |
| 438 | + |
| 439 | + |
| 440 | + |
| 441 | + |
| 442 | + |
| 443 | + |
| 444 | + |
| 445 | + |
| 446 | + |
| 447 | + |
| 448 | + |
| 449 | + |
| 450 | + |
| 451 | + |
| 452 | + |
| 453 | + |
| 454 | + |
| 455 | + |
| 456 | + |
| 457 | + |
| 458 | + |
| 459 | + |
| 460 | + |
| 461 | + |
| 462 | + |
| 463 | + |
| 464 | + |
| 465 | + |
| 466 | + |
| 467 | + |
| 468 | + |
| 469 | + |
| 470 | + |
| 471 | + |
| 472 | + |
| 473 | + |
| 474 | + |
| 475 | + |
| 476 | + |
| 477 | + |
| 478 | + |
| 479 | + |
| 480 | + |
| 481 | + |
| 482 | + |
| 483 | + |
| 484 | + |
| 485 | + |
| 486 | + |
| 487 | + |
| 488 | + |
| 489 | + |
| 490 | + |
| 491 | + |
| 492 | + |
| 493 | + |
| 494 | + |
| 495 | + |
| 496 | + |
| 497 | + |
| 498 | + |
| 499 | + |
| 500 | + |
| 501 | + |
| 502 | + |
| 503 | + |
| 504 | + |
446 | 505 | |
447 | 506 | |
448 | 507 | |
|
0 commit comments