Urgent.News

What's breaking now, across thousands of outlets.

Tech

When Skipping an API Error Can Delete Valid Data: A Cartography Fix

TL;DR: I fixed a BigQuery sync failure in Cartography, then narrowed the error tolerance after review showed that skipping failed enumeration could feed false deletions into graph cleanup. One malformed BigQuery table could stop a Cartography GCP sync. My first patch let more API errors be skipped, but an automated reviewer caught a risk I had missed: a failed list request could leave cleanup…

When correcting a BigQuery synchronization issue in the Cartography project, I discovered that allowing skipped API errors could inadvertently delete valid data. Cartography, a CNCF sandbox project written in Python, gathers infrastructure assets and their relationships and stores them in a Neo4j graph. The project's BigQuery ingestion process lists resources, fetches additional details, loads the results, and performs cleanup.

One problematic scenario was an external table with invalid Delta Lake files causing BigQuery to return HTTP 400 with the reason invalidQuery. When this error was caught by the original code, a sync failure occurred. I fixed this by changing the error tolerance policy for BigQuery handlers. My first patch allowed more API errors to be skipped, but an automated reviewer flagged a risk: a failed list request could result in the cleanup deleting valid inventory nodes.

I traced this issue through the sync code and adjusted which errors the patch would tolerate. A single malformed table could stop the Cartography GCP sync. The fix involved identifying the cause and ensuring the appropriate handlers behaved correctly. Handlers for table details, datasets, and lists had specific behaviors, with table details returning None to preserve the listed table and datasets handling the error differently to maintain the listed dataset.

This approach avoided incomplete data appearing as resource removal, preserving the inventory's trustworthiness.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Klaviyo vs Shopify Email: When to Switch

Stay on Shopify Email, now sold as Shopify Messaging, while 10,000 free emails a month covers your sends and your automations fit its templates (Shopify help centre, 4 October 2026).

  • Shopify Email offers free email marketing up to 10,000 emails/month.
  • Klaviyo provides native Shopify integration and advanced automation features.
  • Klaviyo's Starter plan starts at $60/month for 250 profiles and 500 emails/month.

More from Monday 5 October →