Skip to content
This repository was archived by the owner on Jul 15, 2024. It is now read-only.

Commit 88a3bcc

Browse files
lostmygithubaccountjcrist
authored andcommitted
fix: execute() to to_pandas()
1 parent ce1be32 commit 88a3bcc

File tree

3 files changed

+17
-17
lines changed

3 files changed

+17
-17
lines changed

examples/Reading-Parquet-Files-using-DuckDB.ipynb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@
8484
" \"year\",\n",
8585
"]\n",
8686
"\n",
87-
"t.select(cols).filter(t[\"family\"].isin([\"Corvidae\"])).limit(5).execute()"
87+
"t.select(cols).filter(t[\"family\"].isin([\"Corvidae\"])).limit(5).to_pandas()"
8888
]
8989
},
9090
{
@@ -104,7 +104,7 @@
104104
},
105105
"outputs": [],
106106
"source": [
107-
"t.count().execute()"
107+
"t.count().to_pandas()"
108108
]
109109
},
110110
{
@@ -154,7 +154,7 @@
154154
" .limit(10000)\n",
155155
" .group_by(\"species\")\n",
156156
" .count()\n",
157-
" .execute()\n",
157+
" .to_pandas()\n",
158158
")\n",
159159
"\n",
160160
"print(df.shape)\n",

examples/campaign-finance.ipynb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@
378378
"# persist the input data so the following timings of the group_by are accurate.\n",
379379
"subset = featured[\"election_type\", \"amount_bucket\", \"TRANSACTION_AMT\"]\n",
380380
"subset = subset.cache()\n",
381-
"pandas_subset = subset.execute()"
381+
"pandas_subset = subset.to_pandas()"
382382
]
383383
},
384384
{
@@ -420,7 +420,7 @@
420420
"metadata": {},
421421
"outputs": [],
422422
"source": [
423-
"%time summary_by(subset, [\"election_type\", \"amount_bucket\"]).execute(); # .execute() so we actually fetch the data"
423+
"%time summary_by(subset, [\"election_type\", \"amount_bucket\"]).to_pandas(); #to_pandas() so we actually fetch the data"
424424
]
425425
},
426426
{
@@ -500,7 +500,7 @@
500500
"bucket_col = alt.Column(\"amount_bucket:N\", sort=labels)\n",
501501
"\n",
502502
"n_by_bucket = (\n",
503-
" alt.Chart(by_type_and_bucket.execute())\n",
503+
" alt.Chart(by_type_and_bucket.to_pandas())\n",
504504
" .mark_bar()\n",
505505
" .encode(\n",
506506
" x=bucket_col,\n",
@@ -509,7 +509,7 @@
509509
" )\n",
510510
")\n",
511511
"total_by_bucket = (\n",
512-
" alt.Chart(by_type_and_bucket.execute())\n",
512+
" alt.Chart(by_type_and_bucket.to_pandas())\n",
513513
" .mark_bar()\n",
514514
" .encode(\n",
515515
" x=bucket_col,\n",
@@ -559,7 +559,7 @@
559559
"metadata": {},
560560
"outputs": [],
561561
"source": [
562-
"alt.Chart(gb2.execute()).mark_bar().encode(\n",
562+
"alt.Chart(gb2.to_pandas()).mark_bar().encode(\n",
563563
" x=\"election_type:O\",\n",
564564
" y=\"frac_n_donations_per_election_type:Q\",\n",
565565
" color=bucket_col,\n",
@@ -597,7 +597,7 @@
597597
"outputs": [],
598598
"source": [
599599
"top_recip = by_recip.order_by(ibis.desc(\"n_donations\")).head(10)\n",
600-
"alt.Chart(top_recip.execute()).mark_bar().encode(\n",
600+
"alt.Chart(top_recip.to_pandas()).mark_bar().encode(\n",
601601
" x=alt.X(\"CMTE_NM:O\", sort=\"-y\"),\n",
602602
" y=\"n_donations:Q\",\n",
603603
")"
@@ -635,7 +635,7 @@
635635
"def top_by(col):\n",
636636
" top = by_loc.order_by(ibis.desc(col)).head(10)\n",
637637
" return (\n",
638-
" alt.Chart(top.execute())\n",
638+
" alt.Chart(top.to_pandas())\n",
639639
" .mark_bar()\n",
640640
" .encode(\n",
641641
" x=alt.X(\"loc:O\", sort=\"-y\"),\n",
@@ -692,7 +692,7 @@
692692
"outputs": [],
693693
"source": [
694694
"months_in_order = list(month_map.values())\n",
695-
"alt.Chart(by_month.execute()).mark_bar().encode(\n",
695+
"alt.Chart(by_month.to_pandas()).mark_bar().encode(\n",
696696
" x=alt.X(\"month_str:O\", sort=months_in_order),\n",
697697
" y=\"n_donations:Q\",\n",
698698
")"

tutorial/03-Expressions-Lazy-Mode-Logging.ipynb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@
133133
"\n",
134134
"At this point, nothing has been requested from the database. We have defined what we want to extract, but we didn't\n",
135135
"request it from the database yet. We can continue building our expression if we haven't finished yet. Or once we\n",
136-
"are done, we can simply request it from the database using the method `.execute()`."
136+
"are done, we can simply request it from the database using the method `.to_pandas()`."
137137
]
138138
},
139139
{
@@ -142,7 +142,7 @@
142142
"metadata": {},
143143
"outputs": [],
144144
"source": [
145-
"countries_expression.execute()"
145+
"countries_expression.to_pandas()"
146146
]
147147
},
148148
{
@@ -202,7 +202,7 @@
202202
"metadata": {},
203203
"source": [
204204
"Since we are in lazy mode (not interactive), those expressions don't request any data from the database\n",
205-
"unless explicitly requested with `.execute()`.\n",
205+
"unless explicitly requested with `.to_pandas()`.\n",
206206
"\n",
207207
"## Logging queries\n",
208208
"\n",
@@ -218,7 +218,7 @@
218218
"source": [
219219
"ibis.options.verbose = True\n",
220220
"\n",
221-
"countries[\"name\", \"continent\", population_in_millions].limit(3).execute()"
221+
"countries[\"name\", \"continent\", population_in_millions].limit(3).to_pandas()"
222222
]
223223
},
224224
{
@@ -266,8 +266,8 @@
266266
"source": [
267267
"ibis.options.verbose_log = log_query_to_file\n",
268268
"\n",
269-
"countries.execute()\n",
270-
"countries[\"name\", \"continent\", population_in_millions].limit(3).execute()"
269+
"countries.to_pandas()\n",
270+
"countries[\"name\", \"continent\", population_in_millions].limit(3).to_pandas()"
271271
]
272272
},
273273
{

0 commit comments

Comments
 (0)