You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: example_notebook/TTD Connector Data SDK Example Notebook.ipynb
+44-10Lines changed: 44 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,10 @@
22
22
"metadata": {},
23
23
"outputs": [],
24
24
"source": [
25
-
"%pip install ttd-databricks"
25
+
"%pip install ttd-databricks\n",
26
+
"\n",
27
+
"# Recommended to restart kerner to use updated packages\n",
28
+
"dbutils.library.restartPython()"
26
29
]
27
30
},
28
31
{
@@ -104,7 +107,22 @@
104
107
{
105
108
"cell_type": "markdown",
106
109
"metadata": {},
107
-
"source": "## Step 4: Inspect the required input schema\n\nUse `get_ttd_input_schema()` to see which columns your DataFrame must contain.\n\nFor more information on the meaning of particular fields and supported data types supported per endpoint refer to the following table:\n\n| Endpoint | Context | Data API | Documentation |\n|---|---|---|---|\n| Advertiser | `AdvertiserContext` | `POST /data/advertiser` | [openTTD](https://open.thetradedesk.com/provider/docsApp/GuidesProvider/audience/doc/post-data-advertiser-external) |\n| Third Party | `ThirdPartyContext` | `POST /data/thirdparty` | [openTTD](https://open.thetradedesk.com/provider/docsApp/GuidesProvider/audience/doc/post-data-thirdparty) |\n| Offline Conversion | `OfflineConversionContext` | `POST /providerapi/offlineconversion` | [openTTD](https://open.thetradedesk.com/advertiser/docsApp/GuidesAdvertiser/data/doc/post-providerapi-offlineconversion) |\n| Deletion / Opt-Out — Advertiser | `DeletionOptOutAdvertiserContext` | `POST /data/deletion-optout/advertiser` | [openTTD](https://open.thetradedesk.com/provider/docsApp/GuidesProvider/audience/doc/post-data-deletion-optout-advertiser-external) |\n| Deletion / Opt-Out — Third Party | `DeletionOptOutThirdPartyContext` | `POST /data/deletion-optout/thirdparty` | [openTTD](https://open.thetradedesk.com/provider/docsApp/GuidesProvider/audience/doc/post-data-deletion-optout-thirdparty) |\n| Deletion / Opt-Out — Merchant | `DeletionOptOutMerchantContext` | `POST /data/deletion-optout/merchant` | [openTTD](https://open.thetradedesk.com/provider/docsApp/GuidesProvider/retail/doc/post-data-deletion-optout-merchant) |"
110
+
"source": [
111
+
"## Step 4: Inspect the required input schema\n",
112
+
"\n",
113
+
"Use `get_ttd_input_schema()` to see which columns your DataFrame must contain.\n",
114
+
"\n",
115
+
"For more information on the meaning of particular fields and supported data types supported per endpoint refer to the following table:\n",
116
+
"\n",
117
+
"| Endpoint | Context | Data API | Documentation |\n",
"source": "# Run batch processing (reads from input_table, writes to output_table)\n\n# process_new_records_only=True filters to rows where updated_at > last run date\n# On the first run, metadata_table is empty so all rows are processed\nclient.batch_process(\n context=context,\n input_table=input_table,\n output_table=output_table,\n metadata_table=metadata_table,\n process_new_records_only=True, # Processes rows updated after last run; processes all rows on first run\n batch_size=1600, # Number of rows grouped together in a single request to The Trade Desk\n parallelism=16, # Number of paralellel workers processing the entries from the input table\n)"
291
+
"source": [
292
+
"# Run batch processing (reads from input_table, writes to output_table)\n",
293
+
"\n",
294
+
"# process_new_records_only=True filters to rows where updated_at > last run date\n",
295
+
"# On the first run, metadata_table is empty so all rows are processed\n",
296
+
"client.batch_process(\n",
297
+
" context=context,\n",
298
+
" input_table=input_table,\n",
299
+
" output_table=output_table,\n",
300
+
" metadata_table=metadata_table,\n",
301
+
" process_new_records_only=True, # Processes rows updated after last run; processes all rows on first run\n",
302
+
" batch_size=1600, # Number of rows grouped together in a single request to The Trade Desk\n",
303
+
" parallelism=16, # Number of paralellel workers processing the entries from the input table\n",
0 commit comments