|
32 | 32 | }, |
33 | 33 | { |
34 | 34 | "cell_type": "code", |
35 | | - "execution_count": 1, |
| 35 | + "execution_count": 2, |
36 | 36 | "id": "ca22f059", |
37 | 37 | "metadata": {}, |
38 | 38 | "outputs": [], |
|
50 | 50 | }, |
51 | 51 | { |
52 | 52 | "cell_type": "code", |
53 | | - "execution_count": 2, |
| 53 | + "execution_count": 3, |
54 | 54 | "id": "1bc5aaf3", |
55 | 55 | "metadata": {}, |
56 | 56 | "outputs": [], |
|
69 | 69 | }, |
70 | 70 | { |
71 | 71 | "cell_type": "code", |
72 | | - "execution_count": 3, |
| 72 | + "execution_count": 4, |
73 | 73 | "id": "f289d250", |
74 | 74 | "metadata": {}, |
75 | 75 | "outputs": [ |
|
96 | 96 | }, |
97 | 97 | { |
98 | 98 | "cell_type": "code", |
99 | | - "execution_count": 4, |
| 99 | + "execution_count": 5, |
100 | 100 | "id": "42bb02ab", |
101 | 101 | "metadata": {}, |
102 | 102 | "outputs": [ |
|
123 | 123 | }, |
124 | 124 | { |
125 | 125 | "cell_type": "code", |
126 | | - "execution_count": 5, |
| 126 | + "execution_count": 6, |
127 | 127 | "id": "ce250157", |
128 | 128 | "metadata": {}, |
129 | 129 | "outputs": [ |
130 | 130 | { |
131 | | - "data": { |
132 | | - "application/vnd.jupyter.widget-view+json": { |
133 | | - "model_id": "a85f5799996d4de1a7912182c43fdf54", |
134 | | - "version_major": 2, |
135 | | - "version_minor": 1 |
136 | | - }, |
137 | | - "text/plain": [ |
138 | | - "TableWidget(page_size=10, row_count=5552452, table_html='<table border=\"1\" class=\"dataframe table table-stripe…" |
139 | | - ] |
140 | | - }, |
141 | | - "metadata": {}, |
142 | | - "output_type": "display_data" |
| 131 | + "ename": "TypeError", |
| 132 | + "evalue": "BigQueryCachingExecutor.execute() got an unexpected keyword argument 'ordered'", |
| 133 | + "output_type": "error", |
| 134 | + "traceback": [ |
| 135 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 136 | + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", |
| 137 | + "\u001b[0;32m~/.pyenv/versions/3.10.18/lib/python3.10/site-packages/IPython/core/formatters.py\u001b[0m in \u001b[0;36m__call__\u001b[0;34m(self, obj)\u001b[0m\n\u001b[1;32m 343\u001b[0m \u001b[0mmethod\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mget_real_method\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mobj\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mprint_method\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 344\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mmethod\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 345\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 346\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 347\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 138 | + "\u001b[0;32m~/src/github.com/googleapis/python-bigquery-dataframes/bigframes/core/log_adapter.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 193\u001b[0m \u001b[0mtask\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mPANDAS_PARAM_TRACKING_TASK\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 194\u001b[0m )\n\u001b[0;32m--> 195\u001b[0;31m \u001b[0;32mraise\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 196\u001b[0m \u001b[0;32mfinally\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 197\u001b[0m \u001b[0m_call_stack\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mpop\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 139 | + "\u001b[0;32m~/src/github.com/googleapis/python-bigquery-dataframes/bigframes/core/log_adapter.py\u001b[0m in \u001b[0;36mwrapper\u001b[0;34m(*args, **kwargs)\u001b[0m\n\u001b[1;32m 178\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 179\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 180\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m*\u001b[0m\u001b[0margs\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;34m**\u001b[0m\u001b[0mkwargs\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 181\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0;34m(\u001b[0m\u001b[0mNotImplementedError\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mTypeError\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mas\u001b[0m \u001b[0me\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 182\u001b[0m \u001b[0;31m# Log method parameters that are implemented in pandas but either missing (TypeError)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 140 | + "\u001b[0;32m~/src/github.com/googleapis/python-bigquery-dataframes/bigframes/dataframe.py\u001b[0m in \u001b[0;36m_repr_html_\u001b[0;34m(self)\u001b[0m\n\u001b[1;32m 857\u001b[0m \u001b[0;31m# This ensures that each cell gets its own widget and prevents\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 858\u001b[0m \u001b[0;31m# unintended sharing between cells\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m--> 859\u001b[0;31m \u001b[0mwidget\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mdisplay\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mTableWidget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdf\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcopy\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 860\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 861\u001b[0m \u001b[0mipython_display\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mwidget\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 141 | + "\u001b[0;32m~/src/github.com/googleapis/python-bigquery-dataframes/bigframes/display/anywidget.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, dataframe)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0;31m# Force execution with explicit destination to get total_rows metadata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 92\u001b[0;31m execute_result = dataframe._block.session._executor.execute( \n\u001b[0m\u001b[1;32m 93\u001b[0m \u001b[0mbigframes\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mArrayValue\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataframe\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_block\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# Wrap in ArrayValue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[0mordered\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 142 | + "\u001b[0;31mTypeError\u001b[0m: BigQueryCachingExecutor.execute() got an unexpected keyword argument 'ordered'" |
| 143 | + ] |
143 | 144 | }, |
144 | 145 | { |
145 | 146 | "data": { |
146 | | - "text/html": [], |
147 | 147 | "text/plain": [ |
148 | 148 | "Computation deferred. Computation will process 171.4 MB" |
149 | 149 | ] |
|
167 | 167 | }, |
168 | 168 | { |
169 | 169 | "cell_type": "code", |
170 | | - "execution_count": 6, |
| 170 | + "execution_count": 7, |
171 | 171 | "id": "6920d49b", |
172 | 172 | "metadata": {}, |
173 | 173 | "outputs": [ |
174 | 174 | { |
175 | | - "name": "stdout", |
176 | | - "output_type": "stream", |
177 | | - "text": [ |
178 | | - "Total pages: 555246\n" |
| 175 | + "ename": "TypeError", |
| 176 | + "evalue": "BigQueryCachingExecutor.execute() got an unexpected keyword argument 'ordered'", |
| 177 | + "output_type": "error", |
| 178 | + "traceback": [ |
| 179 | + "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m", |
| 180 | + "\u001b[0;31mTypeError\u001b[0m Traceback (most recent call last)", |
| 181 | + "\u001b[0;32m<ipython-input-7-49e9807f0359>\u001b[0m in \u001b[0;36m<cell line: 5>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 3\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 4\u001b[0m \u001b[0;31m# Create widget programmatically\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m----> 5\u001b[0;31m \u001b[0mwidget\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mTableWidget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdf\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 6\u001b[0m \u001b[0mprint\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34mf\"Total pages: {math.ceil(widget.row_count / widget.page_size)}\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 7\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n", |
| 182 | + "\u001b[0;32m~/src/github.com/googleapis/python-bigquery-dataframes/bigframes/display/anywidget.py\u001b[0m in \u001b[0;36m__init__\u001b[0;34m(self, dataframe)\u001b[0m\n\u001b[1;32m 90\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 91\u001b[0m \u001b[0;31m# Force execution with explicit destination to get total_rows metadata\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m---> 92\u001b[0;31m execute_result = dataframe._block.session._executor.execute( \n\u001b[0m\u001b[1;32m 93\u001b[0m \u001b[0mbigframes\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcore\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mArrayValue\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mdataframe\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_block\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mexpr\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0;31m# Wrap in ArrayValue\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 94\u001b[0m \u001b[0mordered\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0;32mTrue\u001b[0m\u001b[0;34m,\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n", |
| 183 | + "\u001b[0;31mTypeError\u001b[0m: BigQueryCachingExecutor.execute() got an unexpected keyword argument 'ordered'" |
179 | 184 | ] |
180 | | - }, |
181 | | - { |
182 | | - "data": { |
183 | | - "application/vnd.jupyter.widget-view+json": { |
184 | | - "model_id": "261075a0d1d2487f804926884fe55eb2", |
185 | | - "version_major": 2, |
186 | | - "version_minor": 1 |
187 | | - }, |
188 | | - "text/plain": [ |
189 | | - "TableWidget(page_size=10, row_count=5552452, table_html='<table border=\"1\" class=\"dataframe table table-stripe…" |
190 | | - ] |
191 | | - }, |
192 | | - "execution_count": 7, |
193 | | - "metadata": {}, |
194 | | - "output_type": "execute_result" |
195 | 185 | } |
196 | 186 | ], |
197 | 187 | "source": [ |
|
216 | 206 | }, |
217 | 207 | { |
218 | 208 | "cell_type": "code", |
219 | | - "execution_count": 7, |
| 209 | + "execution_count": null, |
220 | 210 | "id": "12b68f15", |
221 | 211 | "metadata": {}, |
222 | | - "outputs": [ |
223 | | - { |
224 | | - "name": "stdout", |
225 | | - "output_type": "stream", |
226 | | - "text": [ |
227 | | - "Current page: 0\n", |
228 | | - "After next: 1\n", |
229 | | - "After prev: 0\n" |
230 | | - ] |
231 | | - } |
232 | | - ], |
| 212 | + "outputs": [], |
233 | 213 | "source": [ |
234 | 214 | "# Simulate button clicks programmatically\n", |
235 | 215 | "print(\"Current page:\", widget.page)\n", |
|
253 | 233 | }, |
254 | 234 | { |
255 | 235 | "cell_type": "code", |
256 | | - "execution_count": 8, |
| 236 | + "execution_count": null, |
257 | 237 | "id": "a9d5d13a", |
258 | 238 | "metadata": {}, |
259 | | - "outputs": [ |
260 | | - { |
261 | | - "name": "stderr", |
262 | | - "output_type": "stream", |
263 | | - "text": [ |
264 | | - "/usr/local/google/home/swast/src/github.com/googleapis/python-bigquery-dataframes/bigframes/core/array_value.py:231: AmbiguousWindowWarning: Window ordering may be ambiguous, this can cause unstable results.\n", |
265 | | - " warnings.warn(msg, bfe.AmbiguousWindowWarning)\n" |
266 | | - ] |
267 | | - }, |
268 | | - { |
269 | | - "name": "stdout", |
270 | | - "output_type": "stream", |
271 | | - "text": [ |
272 | | - "Small dataset pages: 1\n" |
273 | | - ] |
274 | | - }, |
275 | | - { |
276 | | - "data": { |
277 | | - "application/vnd.jupyter.widget-view+json": { |
278 | | - "model_id": "b37aec5d1c534e9f810e18c4fa7b8491", |
279 | | - "version_major": 2, |
280 | | - "version_minor": 1 |
281 | | - }, |
282 | | - "text/plain": [ |
283 | | - "TableWidget(page_size=10, row_count=5, table_html='<table border=\"1\" class=\"dataframe table table-striped tabl…" |
284 | | - ] |
285 | | - }, |
286 | | - "execution_count": 9, |
287 | | - "metadata": {}, |
288 | | - "output_type": "execute_result" |
289 | | - } |
290 | | - ], |
| 239 | + "outputs": [], |
291 | 240 | "source": [ |
292 | 241 | "# Test with very small dataset\n", |
293 | 242 | "small_df = df.sort_values([\"name\", \"year\", \"state\"]).head(5)\n", |
294 | 243 | "small_widget = TableWidget(small_df)\n", |
295 | 244 | "print(f\"Small dataset pages: {math.ceil(small_widget.row_count / small_widget.page_size)}\")\n", |
296 | 245 | "small_widget" |
297 | 246 | ] |
298 | | - }, |
299 | | - { |
300 | | - "cell_type": "code", |
301 | | - "execution_count": null, |
302 | | - "id": "c4e5836b-c872-4a9c-b9ec-14f6f338176d", |
303 | | - "metadata": {}, |
304 | | - "outputs": [], |
305 | | - "source": [] |
306 | 247 | } |
307 | 248 | ], |
308 | 249 | "metadata": { |
309 | 250 | "kernelspec": { |
310 | | - "display_name": "Python 3 (ipykernel)", |
| 251 | + "display_name": "3.10.18", |
311 | 252 | "language": "python", |
312 | 253 | "name": "python3" |
313 | 254 | }, |
|
321 | 262 | "name": "python", |
322 | 263 | "nbconvert_exporter": "python", |
323 | 264 | "pygments_lexer": "ipython3", |
324 | | - "version": "3.10.16" |
| 265 | + "version": "3.10.18" |
325 | 266 | } |
326 | 267 | }, |
327 | 268 | "nbformat": 4, |
|
0 commit comments