Repository navigation
fix(cloud): wrap unguarded Cloud SDK calls so 409/422 details surface - #1372
Conversation
… surface Co-Authored-By: AJ Steers <aj@airbyte.io>
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This PyAirbyte VersionYou can test this version of PyAirbyte using the following: # Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791942697-sdkerror-wrap' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1791942697-sdkerror-wrap'PR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
📚 Show Repo GuidanceHelpful ResourcesCommunity SupportQuestions? Join the #pyairbyte channel in our Slack workspace. |
There was a problem hiding this comment.
🟢 Approval recommended
The wrappers consistently follow the established error-conversion pattern and the reported failure paths have focused regression coverage.
0 open findings
What changed in this PR
Wraps previously unguarded Cloud SDK calls so API errors surface as structured PyAirbyte exceptions.
Changes:
- Wraps
SDKErroracross 14 Cloud API operations. - Adds regression tests for 409 and 422 problem details.
| File | Description |
|---|---|
airbyte/_util/api_util.py |
Converts raw SDK failures into structured Cloud errors. |
tests/unit_tests/test_cloud_api_util.py |
Tests error detail, cause, and status preservation. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit b9fb8a4 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit b9fb8a4 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit b9fb8a4 in the Show a line coverage summary of the most covered files.
Updated |
d39d804
into
release-candidate/v1
Summary
airbyte/_util/api_util.pynow catchSDKErrorand raise_wrap_sdk_error(e)SDKError, bypassingparse_cloud_error. MCP telemetry showed rawSDKErroroncancel_cloud_sync(409 "Job is not currently running") andupdate_cloud_connector_config(422 schema validation)AirbyteCloudError/AirbyteMissingResourceError/AirbyteConnectorNotReadyErrorwith the problemdetailas the message, plus request URL and status incontextChanges
cancel_job,create_source,patch_source,delete_source,create_destination,patch_destination,delete_destination,delete_connection,create/list/get/update/delete_custom_yaml_source_definition,list_organizations_for_user.cancel_joband 422 onpatch_source(viaresponses) assert the parseddetailmessage, theSDKErrorcause, and the status in context. Both fail without the fix.Review Spotlight
Breaking for direct callers of these 14
airbyte._util.api_utilfunctions: code that didexcept SDKErroraround them now getsAirbyteCloudErrorsubclasses, with the originalSDKErroras__cause__. Nothing inairbyte/catchesSDKErrorfrom these functions. The MCP error path (_cloud_error_info) already walks__cause__, so MCP messages keep the parsed problem.Test plan
ruff check/ruff format: clean.pytest tests/unit_tests/test_cloud_api_util.py test_mcp_tool_errors.py test_mcp_cloud.py test_cloud_connections.py: 569 passed.Link to Devin session: https://app.devin.ai/sessions/8fbdc1e4380941958b0bed24914614f2
Open in Devin Desktop: https://app.devin.ai/desktop/session/8fbdc1e4380941958b0bed24914614f2?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)