@@ -677,10 +677,10 @@ from google.cloud.iam_admin_v1 import types
677677iam_admin_client = iam_admin_v1.IAMClient()
678678request = types.CreateServiceAccountRequest()
679679
680+ account_id = "bigframes-no-permissions"
680681request.account_id = account_id
681682request.name = f"projects/{project_id}"
682683
683- account_id = "bigframes-no-permissions"
684684display_name = "bigframes remote function (no permissions)"
685685service_account = types.ServiceAccount()
686686service_account.display_name = display_name
@@ -704,7 +704,13 @@ bqclient.create_dataset(dataset, exists_ok=True)
704704
705705### Deploying a remote function
706706
707- Now, deploy your function to the dataset you just created. Add a
707+ Enable the Cloud Functions API if not yet already enabled.
708+
709+ ```
710+ !gcloud services enable cloudfunctions.googleapis.com
711+ ```
712+
713+ Now, deploy your function to the dataset you just created. Add a
708714` @bpd.remote_function ` decorator to the function you created in the previous
709715steps.
710716
@@ -722,7 +728,7 @@ bpd.options.display.repr_mode = "deferred"
722728 # TODO: Replace this with your version of nltk.
723729 packages=["nltk==3.9.1"],
724730 # Replace this with your service account email.
725- cloud_function_service_account="bigframes-no-permissions@your-project-id .iam.gserviceaccount.com",
731+ cloud_function_service_account=f "bigframes-no-permissions@{project_id} .iam.gserviceaccount.com",
726732 cloud_function_ingress_settings="internal-only",
727733)
728734def lemmatize(word: str) -> str:
@@ -759,7 +765,7 @@ import bigframes.pandas as bpd
759765bpd.options.bigquery.ordering_mode = "partial"
760766bpd.options.display.repr_mode = "deferred"
761767
762- lemmatize = bpd.read_gbq_function("swast-scratch .functions.lemmatize")
768+ lemmatize = bpd.read_gbq_function(f"{project_id} .functions.lemmatize")
763769
764770words = bpd.Series(["whiskies", "whisky", "whiskey", "vodkas", "vodka"])
765771words.apply(lemmatize).to_pandas()
0 commit comments