From 510cb2193506c525da88ab3e59c4658b9fcfdfa8 Mon Sep 17 00:00:00 2001 From: Lindsey Volta Date: Wed, 26 Aug 2026 21:59:34 +0000 Subject: [PATCH 1/4] Add check for ingestion field warnings --- samples/audiences/ingest_audience_members.py | 6 ++++++ samples/events/ingest_events.py | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/samples/audiences/ingest_audience_members.py b/samples/audiences/ingest_audience_members.py index 9ab43ca..7947649 100755 --- a/samples/audiences/ingest_audience_members.py +++ b/samples/audiences/ingest_audience_members.py @@ -251,6 +251,12 @@ def main( # Logs the response. _logger.info("Response for request #%d:\n%s", request_count, response) + if response.field_warnings: + _logger.warning( + "Field warnings found in response. Review " + "warning details and resend the request if needed." + ) + _logger.info("# of requests sent: %d", request_count) diff --git a/samples/events/ingest_events.py b/samples/events/ingest_events.py index eb522f3..29bb461 100755 --- a/samples/events/ingest_events.py +++ b/samples/events/ingest_events.py @@ -199,6 +199,12 @@ def main( # Logs the response. _logger.info("Response for request #%d:\n%s", request_count, response) + if response.field_warnings: + _logger.warning( + "Field warnings found in response. Review " + "warning details and resend the request if needed." + ) + _logger.info("# of requests sent: %d", request_count) From 6c45d984ecb479b53cbd35a485857f3851198eb4 Mon Sep 17 00:00:00 2001 From: Lindsey Volta Date: Thu, 27 Aug 2026 16:19:26 +0000 Subject: [PATCH 2/4] add field warning check to notebooks --- notebooks/audience_e2e_advertiser_flow.ipynb | 15 +++-- ...dience_e2e_data_partner_dual_persona.ipynb | 15 +++-- ...audience_e2e_data_partner_simplified.ipynb | 7 +- samples/events/ingest_events.py | 14 ++++ samples/sampledata/events_with_warnings.json | 67 +++++++++++++++++++ 5 files changed, 104 insertions(+), 14 deletions(-) create mode 100644 samples/sampledata/events_with_warnings.json diff --git a/notebooks/audience_e2e_advertiser_flow.ipynb b/notebooks/audience_e2e_advertiser_flow.ipynb index 5ba3869..b7fdbdf 100644 --- a/notebooks/audience_e2e_advertiser_flow.ipynb +++ b/notebooks/audience_e2e_advertiser_flow.ipynb @@ -112,6 +112,7 @@ }, { "cell_type": "markdown", + "id": "cdd998cb", "metadata": {}, "source": [ " \n", @@ -126,8 +127,7 @@ " View source on GitHub\n", " \n", "
" - ], - "id": "cdd998cb" + ] }, { "cell_type": "markdown", @@ -481,9 +481,12 @@ " request=ingest_payload\n", " )\n", "\n", - " ingestion_request_id = ingest_res.request_id\n", " print(f\"Ingestion Submitted!\")\n", - " print(f\"Request ID: {ingestion_request_id}\")\n", + " print(f\"{ingest_res}\")\n", + "\n", + " if ingest_res.field_warnings:\n", + " print(\"Field warnings found in response. Review \"\n", + " \"warning details and resend the request if needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", @@ -499,10 +502,10 @@ { "cell_type": "code", "execution_count": null, + "id": "c93a9f18", "metadata": {}, "outputs": [], - "source": [], - "id": "c93a9f18" + "source": [] }, { "cell_type": "markdown", diff --git a/notebooks/audience_e2e_data_partner_dual_persona.ipynb b/notebooks/audience_e2e_data_partner_dual_persona.ipynb index 1bebe26..7773ac0 100644 --- a/notebooks/audience_e2e_data_partner_dual_persona.ipynb +++ b/notebooks/audience_e2e_data_partner_dual_persona.ipynb @@ -112,6 +112,7 @@ }, { "cell_type": "markdown", + "id": "e31a76c3", "metadata": {}, "source": [ " \n", @@ -126,8 +127,7 @@ " View source on GitHub\n", " \n", "
" - ], - "id": "e31a76c3" + ] }, { "cell_type": "markdown", @@ -652,9 +652,12 @@ " request=ingest_payload\n", " )\n", "\n", - " ingestion_request_id = ingest_res.request_id\n", " print(f\"Ingestion Submitted!\")\n", - " print(f\"Request ID: {ingestion_request_id}\")\n", + " print(f\"{ingest_res}\")\n", + "\n", + " if ingest_res.field_warnings:\n", + " print(\"Field warnings found in response. Review \"\n", + " \"warning details and resend the request if needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", @@ -670,10 +673,10 @@ { "cell_type": "code", "execution_count": null, + "id": "1cc3db4d", "metadata": {}, "outputs": [], - "source": [], - "id": "1cc3db4d" + "source": [] }, { "cell_type": "markdown", diff --git a/notebooks/audience_e2e_data_partner_simplified.ipynb b/notebooks/audience_e2e_data_partner_simplified.ipynb index ee75cee..01011f9 100644 --- a/notebooks/audience_e2e_data_partner_simplified.ipynb +++ b/notebooks/audience_e2e_data_partner_simplified.ipynb @@ -493,9 +493,12 @@ " request=ingest_payload\n", " )\n", "\n", - " ingestion_request_id = ingest_res.request_id\n", " print(f\"Ingestion Submitted!\")\n", - " print(f\"Request ID: {ingestion_request_id}\")\n", + " print(f\"{ingest_res}\")\n", + "\n", + " if ingest_res.field_warnings:\n", + " print(\"Field warnings found in response. Review \"\n", + " \"warning details and resend the request if needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", diff --git a/samples/events/ingest_events.py b/samples/events/ingest_events.py index 29bb461..74cd7e6 100755 --- a/samples/events/ingest_events.py +++ b/samples/events/ingest_events.py @@ -134,6 +134,20 @@ def main( event_row["phone_number"], ) + if "cartData" in event_row: + cart_data = datamanager_v1.CartData() + cart_data_row = event_row["cartData"] + if "items" in cart_data_row: + for item in cart_data_row["items"]: + cart_data.items.append( + datamanager_v1.Item( + item_id=item["id"], + quantity=item["quantity"], + unit_price=item["unitPrice"], + ) + ) + event.cart_data = cart_data + if user_data.user_identifiers: event.user_data = user_data diff --git a/samples/sampledata/events_with_warnings.json b/samples/sampledata/events_with_warnings.json new file mode 100644 index 0000000..c95ce2a --- /dev/null +++ b/samples/sampledata/events_with_warnings.json @@ -0,0 +1,67 @@ +[ + { + "timestamp": "2025-06-05T23:10:12-05:00", + "transactionId": "ABC1234567", + "eventSource": "WEB", + "value": 5.31, + "currency": "USD", + "emails": [ + "dana@example.com", + "DanaM@example.com" + ] + }, + { + "timestamp": "2025-06-06T16:45:09.333Z", + "transactionId": "DEF987654321", + "eventSource": "WEB", + "value": 1.99, + "currency": "USD", + "gclid": "GCLID123", + "emails": [ + "ALEXF@example.com", + "AlexF@cymbalgroup.com", + "alexF@altostrat.com" + ], + "cartData": { + "currency": "USD", + "items": [ + { + "id": "SKU01", + "quantity": 1, + "unitPrice": 9.99 + } + ] + }, + "phoneNumbers": [ + "+1-800-555-0100", + "+1 800-555-0101", + "+1 800-555-0102" + ] + }, + { + "timestamp": "2025-06-05T11:42:17.177+03:00", + "transactionId": "GHI5656565656", + "eventSource": "WEB", + "value": 0.52, + "currency": "EUR", + "gclid": "GCLID456", + "emails": [ + "quinn@CYMBALGROUP.com", + "baklavainthebalkans@gmail.com" + ] + }, + { + "timestamp": "2025-06-06T09:22:16Z", + "transactionId": "JKL333333333", + "eventSource": "WEB", + "value": 3.99, + "currency": "GBP", + "emails": [ + "rosario@example.org", + "cloudySanFrancisco@GMAIL.com" + ], + "phoneNumbers": [ + "+1-800-555-0110" + ] + } +] \ No newline at end of file From 061195fc847d8fb94631eec37a775bccf8e06c0b Mon Sep 17 00:00:00 2001 From: Lindsey Volta Date: Thu, 27 Aug 2026 16:36:53 +0000 Subject: [PATCH 3/4] update log message --- notebooks/audience_e2e_advertiser_flow.ipynb | 4 ++-- notebooks/audience_e2e_data_partner_dual_persona.ipynb | 4 ++-- notebooks/audience_e2e_data_partner_simplified.ipynb | 4 ++-- samples/audiences/ingest_audience_members.py | 4 ++-- samples/events/ingest_events.py | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/notebooks/audience_e2e_advertiser_flow.ipynb b/notebooks/audience_e2e_advertiser_flow.ipynb index b7fdbdf..67618f3 100644 --- a/notebooks/audience_e2e_advertiser_flow.ipynb +++ b/notebooks/audience_e2e_advertiser_flow.ipynb @@ -485,8 +485,8 @@ " print(f\"{ingest_res}\")\n", "\n", " if ingest_res.field_warnings:\n", - " print(\"Field warnings found in response. Review \"\n", - " \"warning details and resend the request if needed.\")\n", + " print(\"Field warnings found in response. Review warning \"\n", + " \"details and update your implementation as needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", diff --git a/notebooks/audience_e2e_data_partner_dual_persona.ipynb b/notebooks/audience_e2e_data_partner_dual_persona.ipynb index 7773ac0..92426cb 100644 --- a/notebooks/audience_e2e_data_partner_dual_persona.ipynb +++ b/notebooks/audience_e2e_data_partner_dual_persona.ipynb @@ -656,8 +656,8 @@ " print(f\"{ingest_res}\")\n", "\n", " if ingest_res.field_warnings:\n", - " print(\"Field warnings found in response. Review \"\n", - " \"warning details and resend the request if needed.\")\n", + " print(\"Request ingested successfully, but field warnings were returned. \"\n", + " \"Review warning details and update your implementation as needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", diff --git a/notebooks/audience_e2e_data_partner_simplified.ipynb b/notebooks/audience_e2e_data_partner_simplified.ipynb index 01011f9..aa0ea6f 100644 --- a/notebooks/audience_e2e_data_partner_simplified.ipynb +++ b/notebooks/audience_e2e_data_partner_simplified.ipynb @@ -497,8 +497,8 @@ " print(f\"{ingest_res}\")\n", "\n", " if ingest_res.field_warnings:\n", - " print(\"Field warnings found in response. Review \"\n", - " \"warning details and resend the request if needed.\")\n", + " print(\"Request ingested successfully, but field warnings were returned. \"\n", + " \"Review warning details and update your implementation as needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", diff --git a/samples/audiences/ingest_audience_members.py b/samples/audiences/ingest_audience_members.py index 7947649..3cdbc15 100755 --- a/samples/audiences/ingest_audience_members.py +++ b/samples/audiences/ingest_audience_members.py @@ -253,8 +253,8 @@ def main( if response.field_warnings: _logger.warning( - "Field warnings found in response. Review " - "warning details and resend the request if needed." + "Request ingested successfully, but field warnings were returned. " + "Review warning details and update your implementation as needed." ) _logger.info("# of requests sent: %d", request_count) diff --git a/samples/events/ingest_events.py b/samples/events/ingest_events.py index 74cd7e6..eab3ab2 100755 --- a/samples/events/ingest_events.py +++ b/samples/events/ingest_events.py @@ -215,8 +215,8 @@ def main( if response.field_warnings: _logger.warning( - "Field warnings found in response. Review " - "warning details and resend the request if needed." + "Request ingested successfully, but field warnings were returned. " + "Review warning details and update your implementation as needed." ) _logger.info("# of requests sent: %d", request_count) From 42162a1a414ea071ecff1ab7aa440e3de90f61d1 Mon Sep 17 00:00:00 2001 From: Lindsey Volta Date: Thu, 27 Aug 2026 16:41:25 +0000 Subject: [PATCH 4/4] revert sample --- notebooks/audience_e2e_advertiser_flow.ipynb | 4 +- samples/events/ingest_events.py | 14 ---- samples/sampledata/events_with_warnings.json | 67 -------------------- 3 files changed, 2 insertions(+), 83 deletions(-) delete mode 100644 samples/sampledata/events_with_warnings.json diff --git a/notebooks/audience_e2e_advertiser_flow.ipynb b/notebooks/audience_e2e_advertiser_flow.ipynb index 67618f3..76037e5 100644 --- a/notebooks/audience_e2e_advertiser_flow.ipynb +++ b/notebooks/audience_e2e_advertiser_flow.ipynb @@ -485,8 +485,8 @@ " print(f\"{ingest_res}\")\n", "\n", " if ingest_res.field_warnings:\n", - " print(\"Field warnings found in response. Review warning \"\n", - " \"details and update your implementation as needed.\")\n", + " print(\"Request ingested successfully, but field warnings were returned. \"\n", + " \"Review warning details and update your implementation as needed.\")\n", "\n", " except Exception as e:\n", " print(f\"Failed to ingest data: {e}\")\n", diff --git a/samples/events/ingest_events.py b/samples/events/ingest_events.py index eab3ab2..c49d66c 100755 --- a/samples/events/ingest_events.py +++ b/samples/events/ingest_events.py @@ -134,20 +134,6 @@ def main( event_row["phone_number"], ) - if "cartData" in event_row: - cart_data = datamanager_v1.CartData() - cart_data_row = event_row["cartData"] - if "items" in cart_data_row: - for item in cart_data_row["items"]: - cart_data.items.append( - datamanager_v1.Item( - item_id=item["id"], - quantity=item["quantity"], - unit_price=item["unitPrice"], - ) - ) - event.cart_data = cart_data - if user_data.user_identifiers: event.user_data = user_data diff --git a/samples/sampledata/events_with_warnings.json b/samples/sampledata/events_with_warnings.json deleted file mode 100644 index c95ce2a..0000000 --- a/samples/sampledata/events_with_warnings.json +++ /dev/null @@ -1,67 +0,0 @@ -[ - { - "timestamp": "2025-06-05T23:10:12-05:00", - "transactionId": "ABC1234567", - "eventSource": "WEB", - "value": 5.31, - "currency": "USD", - "emails": [ - "dana@example.com", - "DanaM@example.com" - ] - }, - { - "timestamp": "2025-06-06T16:45:09.333Z", - "transactionId": "DEF987654321", - "eventSource": "WEB", - "value": 1.99, - "currency": "USD", - "gclid": "GCLID123", - "emails": [ - "ALEXF@example.com", - "AlexF@cymbalgroup.com", - "alexF@altostrat.com" - ], - "cartData": { - "currency": "USD", - "items": [ - { - "id": "SKU01", - "quantity": 1, - "unitPrice": 9.99 - } - ] - }, - "phoneNumbers": [ - "+1-800-555-0100", - "+1 800-555-0101", - "+1 800-555-0102" - ] - }, - { - "timestamp": "2025-06-05T11:42:17.177+03:00", - "transactionId": "GHI5656565656", - "eventSource": "WEB", - "value": 0.52, - "currency": "EUR", - "gclid": "GCLID456", - "emails": [ - "quinn@CYMBALGROUP.com", - "baklavainthebalkans@gmail.com" - ] - }, - { - "timestamp": "2025-06-06T09:22:16Z", - "transactionId": "JKL333333333", - "eventSource": "WEB", - "value": 3.99, - "currency": "GBP", - "emails": [ - "rosario@example.org", - "cloudySanFrancisco@GMAIL.com" - ], - "phoneNumbers": [ - "+1-800-555-0110" - ] - } -] \ No newline at end of file