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

Commit

Permalink
Adding ITP Audit update and Monthly Budget Mover updates, also patchi…
Browse files Browse the repository at this point in the history
…ng App Engine deployment.
  • Loading branch information
pkenjora committed Jun 23, 2020
1 parent 56e5cef commit f9d75ae
Show file tree
Hide file tree
Showing 36 changed files with 1,577 additions and 317 deletions.
62 changes: 31 additions & 31 deletions colabs/itp_audit.ipynb

Large diffs are not rendered by default.

99 changes: 86 additions & 13 deletions colabs/monthly_budget_mover.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,14 @@
},
"source": [
"FIELDS = {\n",
" 'recipe_timezone': 'America/Los_Angeles', # Timezone for report dates.\n",
" 'recipe_name': '', # \n",
" 'spend_report_id': '', # The report Id for the DV360 spend report.\n",
" 'budget_categories': '{\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}', # A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format.\n",
" 'partner_id': '', # The sdf file types.\n",
" 'budget_categories': '{}', # A dictionary to show which IO Ids go under which Category. {\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}\n",
" 'filter_ids': [], # Comma separated list of filter ids for the request.\n",
" 'excluded_ios': '', # A comma separated list of Inserion Order Ids that should be exluded from the budget calculations\n",
" 'filter_type': '', # The filter type for the filter ids.\n",
" 'filter_ids': '', # The filter ids for the request.\n",
" 'version': '5', # The sdf version to be returned.\n",
" 'is_colab': True, # Are you running this in Colab? (This will store the files in Colab instead of Bigquery)\n",
" 'dataset': '', # Dataset that you would like your output tables to be produced in.\n",
"}\n",
"\n",
Expand Down Expand Up @@ -147,22 +149,93 @@
" }\n",
" },\n",
" {\n",
" 'dbm': {\n",
" 'auth': 'user',\n",
" 'report': {\n",
" 'timeout': 90,\n",
" 'filters': {\n",
" 'FILTER_ADVERTISER': {\n",
" 'values': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 7,'default': '','description': 'The comma separated list of Advertiser Ids.'}}\n",
" }\n",
" },\n",
" 'body': {\n",
" 'timezoneCode': {'field': {'name': 'recipe_timezone','kind': 'timezone','description': 'Timezone for report dates.','default': 'America/Los_Angeles'}},\n",
" 'metadata': {\n",
" 'title': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'Monthly_Budget_Mover_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n",
" 'dataRange': 'PREVIOUS_MONTH',\n",
" 'format': 'CSV'\n",
" },\n",
" 'params': {\n",
" 'type': 'TYPE_GENERAL',\n",
" 'groupBys': [\n",
" 'FILTER_ADVERTISER_CURRENCY',\n",
" 'FILTER_INSERTION_ORDER'\n",
" ],\n",
" 'metrics': [\n",
" 'METRIC_REVENUE_ADVERTISER'\n",
" ]\n",
" }\n",
" }\n",
" },\n",
" 'delete': False\n",
" }\n",
" },\n",
" {\n",
" 'monthly_budget_mover': {\n",
" 'auth': 'user',\n",
" 'spend_report_id': {'field': {'name': 'spend_report_id','kind': 'string','order': 2,'default': '','description': 'The report Id for the DV360 spend report.'}},\n",
" 'budget_categories': {'field': {'name': 'budget_categories','kind': 'json','order': 3,'default': '{\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}','description': 'A dictionary to show which IO Ids go under which Category. Please view the solutions page for information on format.'}},\n",
" 'is_colab': {'field': {'name': 'is_colab','kind': 'boolean','default': True,'order': 7,'description': 'Are you running this in Colab? (This will store the files in Colab instead of Bigquery)'}},\n",
" 'report_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'Monthly_Budget_Mover_','order': 1,'description': 'Name of report in DV360, should be unique.'}},\n",
" 'budget_categories': {'field': {'name': 'budget_categories','kind': 'json','order': 3,'default': '{}','description': 'A dictionary to show which IO Ids go under which Category. {\"CATEGORY1\":[12345,12345,12345], \"CATEGORY2\":[12345,12345]}'}},\n",
" 'excluded_ios': {'field': {'name': 'excluded_ios','kind': 'integer_list','order': 4,'description': 'A comma separated list of Inserion Order Ids that should be exluded from the budget calculations'}},\n",
" 'sdf': {\n",
" 'auth': 'user',\n",
" 'version': {'field': {'name': 'version','kind': 'choice','order': 6,'default': '5','description': 'The sdf version to be returned.','choices': ['SDF_VERSION_5','SDF_VERSION_5_1']}},\n",
" 'partner_id': {'field': {'name': 'partner_id','kind': 'integer','order': 1,'description': 'The sdf file types.'}},\n",
" 'file_types': 'INSERTION_ORDER',\n",
" 'filter_type': {'field': {'name': 'filter_type','kind': 'choice','order': 6,'default': '','description': 'The filter type for the filter ids.','choices': ['ADVERTISER_ID','CAMPAIGN_ID','INSERTION_ORDER_ID','INVENTORY_SOURCE_ID','LINE_ITEM_ID','PARTNER_ID']}},\n",
" 'filter_ids': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 7,'default': '','description': 'The filter ids for the request.'}}\n",
" 'filter_type': 'FILTER_TYPE_ADVERTISER_ID',\n",
" 'read': {\n",
" 'filter_ids': {\n",
" 'single_cell': True,\n",
" 'values': {'field': {'name': 'filter_ids','kind': 'integer_list','order': 4,'default': [],'description': 'Comma separated list of filter ids for the request.'}}\n",
" }\n",
" },\n",
" 'time_partitioned_table': False,\n",
" 'create_single_day_table': False,\n",
" 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 6,'default': '','description': 'Dataset to be written to in BigQuery.'}},\n",
" 'table_suffix': ''\n",
" },\n",
" 'out_old_sdf': {\n",
" 'bigquery': {\n",
" 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n",
" 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_OLD_','description': ''}},\n",
" 'schema': [\n",
" ],\n",
" 'skip_rows': 0,\n",
" 'disposition': 'WRITE_TRUNCATE'\n",
" },\n",
" 'file': '/content/old_sdf.csv'\n",
" },\n",
" 'out_new_sdf': {\n",
" 'bigquery': {\n",
" 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n",
" 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_NEW_','description': ''}},\n",
" 'schema': [\n",
" ],\n",
" 'skip_rows': 0,\n",
" 'disposition': 'WRITE_TRUNCATE'\n",
" },\n",
" 'file': '/content/new_sdf.csv'\n",
" },\n",
" 'out': {\n",
" 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n",
" 'old_sdf_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_OLD_','description': ''}},\n",
" 'new_sdf_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_NEW_','description': ''}},\n",
" 'changes_table_name': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_BUDGET_MOVER_LOG_','description': ''}}\n",
" 'out_changes': {\n",
" 'bigquery': {\n",
" 'dataset': {'field': {'name': 'dataset','kind': 'string','order': 8,'default': '','description': 'Dataset that you would like your output tables to be produced in.'}},\n",
" 'table': {'field': {'name': 'recipe_name','kind': 'string','prefix': 'SDF_BUDGET_MOVER_LOG_','description': ''}},\n",
" 'schema': [\n",
" ],\n",
" 'skip_rows': 0,\n",
" 'disposition': 'WRITE_TRUNCATE'\n",
" },\n",
" 'file': '/content/log.csv'\n",
" }\n",
" }\n",
" }\n",
Expand Down
Loading

0 comments on commit f9d75ae

Please sign in to comment.