fix(source-facebook-marketing): Catch AirbyteTracedException in AdAccount.list_objects()#76064
Draft
devin-ai-integration[bot] wants to merge 3 commits intomasterfrom
Draft
Conversation
…ount.list_objects() The backoff give_up handler converts FacebookRequestError to AirbyteTracedException before the except block in list_objects() can catch it. This adds a separate except AirbyteTracedException block that checks the wrapped exception for the same error conditions (owner permission error code 200, funding_source_details error code 100). Follows the exact pattern from PR #75981 which fixed the identical issue in AdCreativesFromAds. Resolves airbytehq/oncall#11860 Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Contributor
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksPR Slash CommandsAirbyte Maintainers (that's you!) can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful Resources
|
Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
|
Deploy preview for airbyte-docs ready! ✅ Preview Built with commit 087905f. |
Contributor
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The
ad_accountstream fails withconfig_errorbecause the backoffgive_uphandler inretry_pattern(common.pyL90-92) convertsFacebookRequestErrorintoAirbyteTracedExceptionbefore theexcept FacebookRequestErrorblock inAdAccount.list_objects()can catch it. This causes known-benign errors (owner permission error code 200, funding_source_details error code 100) to surface as fatal failures instead of being handled gracefully.Resolves https://github.com/airbytehq/oncall/issues/11860
How
Adds a second
except AirbyteTracedExceptionblock inAdAccount.list_objects()that inspects the wrapped_exceptionattribute for the same twoFacebookRequestErrorconditions already handled in the existingexcept FacebookRequestErrorblock:"(#200) Requires business_management permission..."→ removesownerfield and retries"Unsupported request - method type: get"→ removesfunding_source_detailsfield and retriesThis is the exact same pattern merged in PR #75981 for the
AdCreativesFromAdsstream.Review guide
source_facebook_marketing/streams/streams.py— the core fix (newexcept AirbyteTracedExceptionblock after L354). Verify it mirrors the existingexcept FacebookRequestErrorblock correctly.unit_tests/test_streams.py— 4 new parametrized test cases forAdAccount.list_objects(): two happy-path cases (owner removal, funding_source_details removal) and two re-raise cases (unrelated FB error, no wrapped FB error).metadata.yamlandpyproject.tomlboth updated 5.2.4 → 5.2.5.Reviewer checklist
e._exceptionaccess pattern matches PR #75981except FacebookRequestErrorblock exactlyXXXXXindocs/integrations/sources/facebook-marketing.mdwith this PR numberUser Impact
Users whose
ad_accountstream was failing withconfig_errordue to the owner permission or funding_source_details errors will now have those errors handled gracefully (field removed and request retried), matching the behavior before the backoff regression introduced in PR #37341.Can this PR be safely reverted and rolled back?
Link to Devin session: https://app.devin.ai/sessions/b5cd0f2601274e0ebd9268cd2ca90734