Skip to content

Commit 5ed96f8

Browse files
committed
render codelab
1 parent 54ea10e commit 5ed96f8

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

bigquery-dataframes-iowa-liquor-sales/codelab.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"format": "html",
44
"prefix": "https://storage.googleapis.com",
55
"mainga": "UA-49880327-14",
6-
"updated": "2024-12-04T09:50:13-06:00",
6+
"updated": "2024-12-04T11:11:22-06:00",
77
"id": "bigquery-dataframes-iowa-liquor-sales",
88
"duration": 0,
99
"title": "Exploratory data analysis of Iowa liquor sales using the BigQuery DataFrames package",

bigquery-dataframes-iowa-liquor-sales/index.html

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -459,10 +459,10 @@ <h2 is-upgraded>Setup your project for function deployment</h2>
459459
iam_admin_client = iam_admin_v1.IAMClient()
460460
request = types.CreateServiceAccountRequest()
461461

462+
account_id = &#34;bigframes-no-permissions&#34;
462463
request.account_id = account_id
463464
request.name = f&#34;projects/{project_id}&#34;
464465

465-
account_id = &#34;bigframes-no-permissions&#34;
466466
display_name = &#34;bigframes remote function (no permissions)&#34;
467467
service_account = types.ServiceAccount()
468468
service_account.display_name = display_name
@@ -480,6 +480,9 @@ <h2 is-upgraded>Setup your project for function deployment</h2>
480480
bqclient.create_dataset(dataset, exists_ok=True)
481481
</code></pre>
482482
<h2 is-upgraded>Deploying a remote function</h2>
483+
<p>Enable the Cloud Functions API if not yet already enabled.</p>
484+
<pre><code>!gcloud services enable cloudfunctions.googleapis.com
485+
</code></pre>
483486
<p>Now, deploy your function to the dataset you just created. Add a <code>@bpd.remote_function</code> decorator to the function you created in the previous steps.</p>
484487
<pre><code>import bigframes.pandas as bpd
485488

@@ -494,7 +497,7 @@ <h2 is-upgraded>Deploying a remote function</h2>
494497
# TODO: Replace this with your version of nltk.
495498
packages=[&#34;nltk==3.9.1&#34;],
496499
# Replace this with your service account email.
497-
cloud_function_service_account=&#34;bigframes-no-permissions@your-project-id.iam.gserviceaccount.com&#34;,
500+
cloud_function_service_account=f&#34;bigframes-no-permissions@{project_id}.iam.gserviceaccount.com&#34;,
498501
cloud_function_ingress_settings=&#34;internal-only&#34;,
499502
)
500503
def lemmatize(word: str) -&gt; str:
@@ -525,7 +528,7 @@ <h2 is-upgraded>Using the remote functions</h2>
525528
bpd.options.bigquery.ordering_mode = &#34;partial&#34;
526529
bpd.options.display.repr_mode = &#34;deferred&#34;
527530

528-
lemmatize = bpd.read_gbq_function(&#34;swast-scratch.functions.lemmatize&#34;)
531+
lemmatize = bpd.read_gbq_function(f&#34;{project_id}.functions.lemmatize&#34;)
529532

530533
words = bpd.Series([&#34;whiskies&#34;, &#34;whisky&#34;, &#34;whiskey&#34;, &#34;vodkas&#34;, &#34;vodka&#34;])
531534
words.apply(lemmatize).to_pandas()

0 commit comments

Comments
 (0)