Repository navigation
fix(cloud): normalize Cloud execute data/meta response envelope - #1248
Conversation
Co-authored-by: Piotr Kozikowski <piotr.kozikowski@gmail.com> 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/1790299122-cloud-execute-envelope' pyairbyte --help
# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@devin/1790299122-cloud-execute-envelope'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. |
Code Coverage OverviewLanguages: Python Python / code-coverage/pytest-no-credsThe overall line coverage in commit 6b75d73 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytestThe overall line coverage in commit 6b75d73 in the Show a line coverage summary of the most impacted files.
Python / code-coverage/pytest-unitThe overall line coverage in commit 6b75d73 in the Show a line coverage summary of the most covered files.
Updated |
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The reviewed changes correctly normalize Cloud responses and include focused test coverage.
Review effort: Lite
Findings: None
What changed in this PR
Normalizes Cloud execute API responses into the expected result structure while preserving payloads and pagination metadata.
Changes:
- Validates and maps
dataandmetaresponse fields. - Preserves payloads, including falsy and nested values.
- Adds coverage for successful and malformed responses.
| File | Description |
|---|---|
tests/unit_tests/test_cloud_direct_execute.py |
Tests response normalization, metadata mapping, payload preservation, and errors. |
airbyte/_direct_connectors/api_util.py |
Validates and normalizes Cloud execution responses. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…loud_connector_action Co-Authored-By: AJ Steers <aj@airbyte.io>
eeeee1b
into
release-candidate/v1
Summary
Targeted extraction of one piece of #1240 (Piotr Kozikowski (@pkozikow), AGENTIC-2244) so it can land ahead of the rest of that PR.
The Cloud Config API
POST /{sources,destinations}/{id}/executeroutes return{"data": ..., "meta"?: {...}}, butexecute_cloud_connector_actionreturned the raw body and callers validated it asExternalApiExecuteResult(which requiresstatusand readsresult/connector_metadata). As soon as the backend returns a 200 on these routes, everyexecute_api_query/execute_sql_querycall (and theexecute_external_*MCP tools) would fail on model validation.CloudConnector._execute_direct_actionnow returns that typed result directly instead of callingmodel_validateon a dict.datais passed through untouched (includingNone/falsy values and nested{"data","meta"}SQL payloads); top-levelmetabecomesconnector_metadatasohas_next_page/end_cursorresolve as before.Tests:
_patch_executenow fakesrequests.requestand runs the realexecute_cloud_connector_action, so the boundary is exercised; new cases cover payload preservation, top-levelmetamapping, and malformed envelopes.Not included from #1240: write-action rejection, docs-probe resilience,
describeguidance changes.Related: AGENTIC-2274 (backend currently returns 422/502/504 on these routes on the Fusion test workspace — this PR does not change that, it only makes the success path correct).
Link to Devin session: https://app.devin.ai/sessions/131e8cb1f5b547b8b99d66ddfd4b0bda
Open in Devin Desktop: https://app.devin.ai/desktop/session/131e8cb1f5b547b8b99d66ddfd4b0bda?variant=devin
Requested by: Aaron ("AJ") Steers (@aaronsteers)