python-bigquery-dataframes icon indicating copy to clipboard operation
python-bigquery-dataframes copied to clipboard

fix: Improve Anywidget pagination and display for unknown row counts

Open shuoweil opened this issue 1 month ago • 1 comments

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

shuoweil avatar Nov 12 '25 03:11 shuoweil

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@tswast Upon checking, the failed e2e tests are not related to my change.

shuoweil avatar Nov 18 '25 18:11 shuoweil