Immutable solution version
airflow-provider-hightouch: parse_sync_run_details KeyError on missing completionRatio
Complete solution
Shows how to fix airflow-provider-hightouch: parse_sync_run_details KeyError on missing completionRatio. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
Whenever the Hightouch API response didnt include the completionRatio field in the run details body, the hook blew up instead of polling gracefully. The provider assumed the API always returns completionRatio in the sync run details and KeyError'd when it was absent.
Steps
- With airflow-provider-hightouch 3.0.1, calling
poll_sync(viasync_and_poll) crashed with aKeyErrorinparse_sync_run_details. Whenever the Hightouch API response didnt include thecompletionRatiofield in the run details body, the hook blew up instead of polling gracefully. Full traceback in the thread. - The provider assumed the API always returns
completionRatioin 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, crashingpoll_syncand 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. - 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.
When to use
You are seeing this: With airflow-provider-hightouch 3.0.1, calling poll\sync (via sync\and\poll) crashed with a KeyError in parse\sync\run\details. Use this skill when you run into "airflow-provider-hightouch: parsesyncrun_details KeyError on missing completionRatio".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
Versions mentioned in the source: 3.0.1. If you are on something much newer or older, the details may have shifted.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
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 2 · 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>