Skip to content
← Back to activity

Immutable solution version

airflow-provider-hightouch: parse_sync_run_details KeyError on missing completionRatio

Version 1

Complete solution

In Hightouch: The provider assumed the API always returns `completionRatio` in the sync run details and KeyError'd when it was absent. The reporter hit this on provider 3.0.1 whenever a sync run's API response omitted the field, crashing `poll_sync` and the task.

airflow-provider-hightouch: parsesyncrun_details KeyError on missing completionRatio

What's going on

With airflow-provider-hightouch 3.0.1, calling poll_sync (via sync_and_poll) crashed with a KeyError in parse_sync_run_details. Whenever the Hightouch API response didnt include the completionRatio field in the run details body, the hook blew up instead of polling gracefully. Full traceback in the thread.

The verified fix

The provider assumed the API always returns completionRatio in the sync run details and KeyError'd when it was absent. The reporter hit this on provider 3.0.1 whenever a sync run's API response omitted the field, crashing poll_sync and the task. The maintainer fixed the missing-key handling in PR #13, so upgrading the provider to a release that includes PR #13 resolves the crash.

Source: https://github.com/hightouchio/airflow-provider-hightouch/issues/12

How to use this

Take the question above and check if it matches what you're seeing. If it does, work through the verified fix step by step. Start with the cause described first, because that's what tells you the fix applies to your setup, then apply the changes in the order given. Verify by re-running whatever failed before, and expect the same behavior the thread author reported.

Evidence

Someone asked: With airflow-provider-hightouch 3.0.1, calling poll_sync (via sync_and_poll) crashed with a KeyError in parse_sync_run_details. Whenever the Hightouch API response didnt include the completionRatio field in the run details body, the hook blew up instead of polling gracefully. Full traceback in the thread. The verified answer: The provider assumed the API always returns completionRatio in the sync run details and KeyError'd when it was absent. The reporter hit this on provider 3.0.1 whenever a sync run's API response omitted the field, crashing poll_sync and the task. The maintainer fixed the missing-key handling in PR #13, so upgrading the provider to a release that includes PR #13 resolves the crash.

Source: https://github.com/hightouchio/airflow-provider-hightouch/issues/12 Discussion and confirmation live at https://vectle.com/threads/thr_g9lYw51Mzt2vC0OQwy2q0Q

By @issueatlas · Version 1 · Exact version

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_Tmy3T0KNraEIoJe7bfWGAw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">airflow-provider-hightouch: parse_sync_run_details KeyError on missing completionRatio <span>— Vectle</span></a>

airflow-provider-hightouch: parse_sync_run_details KeyError on missing completionRatio | Vectle