Skip to content

Commit 6370f16

Browse files
authored
fix(notebooks): address linter and metadata issues (#9)
1 parent dfbd6b2 commit 6370f16

3 files changed

Lines changed: 38 additions & 13 deletions

File tree

notebooks/audience_e2e_advertiser_flow.ipynb

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
" View source on GitHub</a>\n",
127127
" </td>\n",
128128
" </table>"
129-
]
129+
],
130+
"id": "cdd998cb"
130131
},
131132
{
132133
"cell_type": "markdown",
@@ -273,7 +274,7 @@
273274
" desktop_app_json_file = \"/tmp/oauth_client.json\"\n",
274275
"\n",
275276
" if len(uploaded) != 1:\n",
276-
" raise ValueError(\"Please upload exactly one file.\")\n",
277+
" raise ValueError(\"Upload exactly one file.\")\n",
277278
"\n",
278279
" filename = list(uploaded.keys())[0]\n",
279280
" content = uploaded[filename]\n",
@@ -290,7 +291,7 @@
290291
"\n",
291292
" if authentication_method == \"OAuth Client Credentials\":\n",
292293
" if use_existing_credentials:\n",
293-
" print(\"Please enter your OAuth credentials:\")\n",
294+
" print(\"Enter your OAuth credentials:\")\n",
294295
" client_id = input(\"Client ID: \").strip()\n",
295296
" client_secret = getpass.getpass(\"Client Secret (input will be hidden): \").strip()\n",
296297
" refresh_token = getpass.getpass(\"Refresh Token (input will be hidden): \").strip()\n",
@@ -304,7 +305,7 @@
304305
" scopes=[data_manager_scope]\n",
305306
" )\n",
306307
" else:\n",
307-
" print(\"Authenticating with OAuth via gcloud...\")\n",
308+
" print(\"Authenticating with OAuth Client using gcloud...\")\n",
308309
" client_json_file = prompt_for_desktop_client_json()\n",
309310
" auth_command = (\n",
310311
" f\"gcloud auth application-default login \"\n",
@@ -430,7 +431,7 @@
430431
"\n",
431432
"if not destination_id:\n",
432433
" print(\n",
433-
" \"Error: destination_id is not set. Cannot ingest data. Please ensure the User List was created successfully in the previous step.\"\n",
434+
" \"Error: destination_id is not set. Cannot ingest data. Make sure the User List was created successfully in the previous step.\"\n",
434435
" )\n",
435436
"else:\n",
436437
" print(f\"Ingesting sample data to User List {destination_id}...\")\n",
@@ -493,6 +494,14 @@
493494
" print(\"----------------------------\\n\")"
494495
]
495496
},
497+
{
498+
"cell_type": "code",
499+
"execution_count": null,
500+
"metadata": {},
501+
"outputs": [],
502+
"source": [],
503+
"id": "c93a9f18"
504+
},
496505
{
497506
"cell_type": "markdown",
498507
"id": "68eab82f",
@@ -561,5 +570,5 @@
561570
}
562571
},
563572
"nbformat": 4,
564-
"nbformat_minor": 0
573+
"nbformat_minor": 5
565574
}

notebooks/audience_e2e_data_partner_dual_persona.ipynb

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,8 @@
126126
" View source on GitHub</a>\n",
127127
" </td>\n",
128128
" </table>"
129-
]
129+
],
130+
"id": "e31a76c3"
130131
},
131132
{
132133
"cell_type": "markdown",
@@ -302,7 +303,7 @@
302303
" uploaded = files.upload()\n",
303304
"\n",
304305
" if len(uploaded) != 1:\n",
305-
" raise ValueError(\"Please upload exactly one file\")\n",
306+
" raise ValueError(\"Upload exactly one file\")\n",
306307
"\n",
307308
" filename = list(uploaded.keys())[0]\n",
308309
" content = uploaded[filename]\n",
@@ -350,7 +351,7 @@
350351
" print(\"Using existing Advertiser OAuth credentials\")\n",
351352
" print()\n",
352353
" # Prompts the user for the client ID, client secret, and refresh token.\n",
353-
" print(\"Please enter your preexisting Advertiser OAuth credentials:\")\n",
354+
" print(\"Enter your preexisting Advertiser OAuth credentials:\")\n",
354355
" advertiser_oauth_client_id = input(\"Client ID: \").strip()\n",
355356
" advertiser_oauth_client_secret = getpass.getpass(\n",
356357
" \"Client Secret (input will be hidden): \"\n",
@@ -600,7 +601,7 @@
600601
"\n",
601602
"if not destination_id:\n",
602603
" print(\n",
603-
" \"Error: destination_id is not set. Cannot ingest data. Please ensure the User List was created successfully in the previous step.\"\n",
604+
" \"Error: destination_id is not set. Cannot ingest data. Make sure the User List was created successfully in the previous step.\"\n",
604605
" )\n",
605606
"else:\n",
606607
" print(f\"Ingesting sample data to User List {destination_id}...\")\n",
@@ -664,6 +665,14 @@
664665
" print(\"----------------------------\\n\")"
665666
]
666667
},
668+
{
669+
"cell_type": "code",
670+
"execution_count": null,
671+
"metadata": {},
672+
"outputs": [],
673+
"source": [],
674+
"id": "1cc3db4d"
675+
},
667676
{
668677
"cell_type": "markdown",
669678
"id": "c4eab526",
@@ -732,5 +741,5 @@
732741
}
733742
},
734743
"nbformat": 4,
735-
"nbformat_minor": 0
744+
"nbformat_minor": 5
736745
}

notebooks/audience_e2e_data_partner_simplified.ipynb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@
112112
},
113113
{
114114
"cell_type": "markdown",
115+
"id": "7f243813",
115116
"metadata": {},
116117
"source": [
117118
" <table class=\"tfo-notebook-buttons nocontent\" align=\"left\">\n",
@@ -391,6 +392,12 @@
391392
" print(f\"Resource Name: {ulist_res.name}\")\n",
392393
" print(f\"Display Name: {ulist_res.display_name}\")\n",
393394
"\n",
395+
"except exceptions.PermissionDenied as e:\n",
396+
" print(f\"User list creation failed due to permission denied error: {e}\")\n",
397+
" print(\n",
398+
" \"Review the 'Prerequisites' section and verify that the service account has the required \"\n",
399+
" \"access level in the data partner account.\"\n",
400+
" )\n",
394401
"except Exception as e:\n",
395402
" print(f\"Failed to create User List: {e}\")\n",
396403
"\n",
@@ -430,7 +437,7 @@
430437
"\n",
431438
"if not destination_id:\n",
432439
" print(\n",
433-
" \"Error: destination_id is not set. Cannot ingest data. Please ensure the User List was created successfully in the previous step.\"\n",
440+
" \"Error: destination_id is not set. Cannot ingest data. Make sure the User List was created successfully in the previous step.\"\n",
434441
" )\n",
435442
"else:\n",
436443
" print(f\"5. Ingesting sample data to User List {destination_id}...\")\n",
@@ -612,5 +619,5 @@
612619
}
613620
},
614621
"nbformat": 4,
615-
"nbformat_minor": 0
622+
"nbformat_minor": 5
616623
}

0 commit comments

Comments
 (0)