| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 3cb57b1 commit 4e2689a
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,25 +133,26 @@ def _initial_load(self) -> None: | |||
| 133 | 133 | # obtain the row counts | |
| 134 | 134 | # TODO(b/428238610): Start iterating over the result of `to_pandas_batches()` | |
| 135 | 135 | # before we get here so that the count might already be cached. | |
| 136 | - self._reset_batches_for_new_page_size() | ||
| 136 | + with bigframes.option_context("display.progress_bar", None): | ||
| 137 | + self._reset_batches_for_new_page_size() | ||
| 137 | 138 | ||
| 138 | - if self._batches is None: | ||
| 139 | - self._error_message = ( | ||
| 140 | - "Could not retrieve data batches. Data might be unavailable or " | ||
| 141 | - "an error occurred." | ||
| 142 | - ) | ||
| 143 | - self.row_count = None | ||
| 144 | - elif self._batches.total_rows is None: | ||
| 145 | - # Total rows is unknown, this is an expected state. | ||
| 146 | - # TODO(b/461536343): Cheaply discover if we have exactly 1 page. | ||
| 147 | - # There are cases where total rows is not set, but there are no additional | ||
| 148 | - # pages. We could disable the "next" button in these cases. | ||
| 149 | - self.row_count = None | ||
| 150 | - else: | ||
| 151 | - self.row_count = self._batches.total_rows | ||
| 139 | + if self._batches is None: | ||
| 140 | + self._error_message = ( | ||
| 141 | + "Could not retrieve data batches. Data might be unavailable or " | ||
| 142 | + "an error occurred." | ||
| 143 | + ) | ||
| 144 | + self.row_count = None | ||
| 145 | + elif self._batches.total_rows is None: | ||
| 146 | + # Total rows is unknown, this is an expected state. | ||
| 147 | + # TODO(b/461536343): Cheaply discover if we have exactly 1 page. | ||
| 148 | + # There are cases where total rows is not set, but there are no additional | ||
| 149 | + # pages. We could disable the "next" button in these cases. | ||
| 150 | + self.row_count = None | ||
| 151 | + else: | ||
| 152 | + self.row_count = self._batches.total_rows | ||
| 152 | 153 | ||
| 153 | - # get the initial page | ||
| 154 | - self._set_table_html() | ||
| 154 | + # get the initial page | ||
| 155 | + self._set_table_html() | ||
| 155 | 156 | ||
| 156 | 157 | @traitlets.observe("_initial_load_complete") | |
| 157 | 158 | def _on_initial_load_complete(self, change: dict[str, Any]): | |
@@ -274,14 +275,17 @@ def _reset_batch_cache(self) -> None: | |||
| 274 | 275 | ||
| 275 | 276 | def _reset_batches_for_new_page_size(self) -> None: | |
| 276 | 277 | """Reset the batch iterator when page size changes.""" | |
| 277 | - self._batches = self._dataframe.to_pandas_batches(page_size=self.page_size) | ||
| 278 | + with bigframes.option_context("display.progress_bar", None): | ||
| 279 | + self._batches = self._dataframe.to_pandas_batches(page_size=self.page_size) | ||
| 278 | 280 | ||
| 279 | 281 | self._reset_batch_cache() | |
| 280 | 282 | ||
| 281 | 283 | def _set_table_html(self) -> None: | |
| 282 | 284 | """Sets the current html data based on the current page and page size.""" | |
| 283 | 285 | new_page = None | |
| 284 | - with self._setting_html_lock: | ||
| 286 | + with self._setting_html_lock, bigframes.option_context( | ||
| 287 | + "display.progress_bar", None | ||
| 288 | + ): | ||
| 285 | 289 | if self._error_message: | |
| 286 | 290 | self.table_html = ( | |
| 287 | 291 | f"<div class='bigframes-error-message'>" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments