Skip to content

fix(cloud): support the queued job status - #1334

Merged
Aaron ("AJ") Steers (aaronsteers) merged 4 commits into
release-candidate/v1from
cameron/fix-queued-job-status
Oct 7, 2026
Merged

Aaron ("AJ") Steers (aaronsteers) merged 4 commits into
release-candidate/v1from
cameron/fix-queued-job-status

Conversation

@cjkenned

Copy link
Copy Markdown
Contributor

Summary

list_cloud_sync_jobs (and anything else that decodes Cloud job responses) fails with ValueError: 'queued' is not a valid JobStatusEnum when a connection has a queued job.

The error comes from the airbyte-api SDK, not PyAirbyte: we pin airbyte-api<1.0, and its JobStatusEnum has no queued member, so decoding the jobs page fails before our code sees it. queued is only defined in airbyte-api 1.x, which is a full SDK rewrite (pydantic and httpx instead of dataclasses and requests). Upgrading is too big for a patch, so this PR uses a stopgap.

Changes

  • airbyte/_util/api_util.py: _register_queued_job_status() runs once on import and adds a QUEUED member to the SDK's JobStatusEnum. It does nothing if the SDK already defines queued, so it can be deleted when we move to airbyte-api 1.x.
  • airbyte/cloud/models.py: adds QUEUED = "queued" to PyAirbyte's public JobStatusEnum. It is not in FINAL_STATUSES, so code waiting on a sync keeps polling through a queued job.
  • airbyte/mcp/cloud.py: adds 'queued' to the example statuses in the SyncJobResult.status docstring.
  • New unit test that decodes a jobs response with "status": "queued" and checks it maps to JobStatusEnum.QUEUED.

Testing

  • Checked that decoding works on Python 3.10, 3.11 and 3.12.
  • pytest tests/unit_tests/test_cloud_api_util.py tests/unit_tests/test_cloud_models.py tests/unit_tests/test_mcp_cloud.py: 92 passed.
  • ruff check, ruff format --check and pyrefly check all pass.

Follow-up

Upgrading to airbyte-api 1.x should go in its own PR against release-candidate/v1, and that PR can remove _register_queued_job_status(). Note that 1.x still uses a closed enum, so a future new status would fail the same way, as a pydantic ValidationError instead of a ValueError.

🤖 Generated with Claude Code

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…1304)

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The Airbyte API returns `queued` for jobs waiting to start, but
`airbyte-api<1.0` doesn't define it, so listing jobs that include a
queued job raised `ValueError: 'queued' is not a valid JobStatusEnum`.

Register `QUEUED` on the SDK enum at import time (a no-op once the SDK
defines it) and add `QUEUED` to PyAirbyte's public `JobStatusEnum`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@octavia-bot
octavia-bot Bot marked this pull request as draft October 5, 2026 23:56
@octavia-bot

octavia-bot Bot commented Oct 5, 2026

Copy link
Copy Markdown

Note

📝 PR Converted to Draft

More info...

Thank you for creating this PR. As a policy to protect our engineers' time, Airbyte requires all PRs to be created first in draft status. Your PR has been automatically converted to draft status in respect for this policy.

As soon as your PR is ready for formal review, you can proceed to convert the PR to "ready for review" status by clicking the "Ready for review" button at the bottom of the PR page.

To skip draft status in future PRs, please include [ready] in your PR title or add the skip-draft-status label when creating your PR.

@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

👋 Greetings, Airbyte Team Member!

Here are some helpful tips and reminders for your convenience.

💡 Show Tips and Tricks

Testing This PyAirbyte Version

You can test this version of PyAirbyte using the following:

# Run PyAirbyte CLI from this branch:
uvx --from 'git+https://github.com/airbytehq/PyAirbyte.git@cameron/fix-queued-job-status' pyairbyte --help

# Install PyAirbyte from this branch for development:
pip install 'git+https://github.com/airbytehq/PyAirbyte.git@cameron/fix-queued-job-status'

PR Slash Commands

Airbyte Maintainers can execute the following slash commands on your PR:

  • /fix-pr - Fixes most formatting and linting issues
  • /uv-lock - Updates uv.lock file
  • /test-pr - Runs tests with the updated PyAirbyte
  • /prerelease - Builds and publishes a prerelease version to PyPI
📚 Show Repo Guidance

Helpful Resources

Community Support

Questions? Join the #pyairbyte channel in our Slack workspace.

📝 Edit this welcome message.

@cjkenned
Cam Kennedy (cjkenned) marked this pull request as ready for review October 6, 2026 00:00
@github-code-quality

github-code-quality Bot commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Code Coverage Overview

Languages: Python

Python / code-coverage/pytest-no-creds

The overall line coverage in commit 5ec956e in the cameron/fix-queued-j... branch is 77%. The line coverage in commit d9f652f in the main branch is 65%.

Show a line coverage summary of the most impacted files.
File main d9f652f cameron/fix-queued-j... 5ec956e +/-
airbyte/mcp/cloud.py 52% 71% +19%
airbyte/_util/api_util.py 36% 56% +20%
airbyte/mcp/_otel.py 0% 89% +89%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/cloud/models.py 0% 95% +95%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%
airbyte/_direct...nnector_docs.py 0% 97% +97%
airbyte/mcp/agents.py 0% 98% +98%
airbyte/_direct...ctors/models.py 0% 99% +99%

Python / code-coverage/pytest

The overall line coverage in commit 5ec956e in the cameron/fix-queued-j... branch is 80%. The line coverage in commit d9f652f in the main branch is 71%.

Show a line coverage summary of the most impacted files.
File main d9f652f cameron/fix-queued-j... 5ec956e +/-
airbyte/mcp/cloud.py 52% 71% +19%
airbyte/mcp/_otel.py 0% 89% +89%
airbyte/mcp/int..._registry_ui.py 0% 92% +92%
airbyte/_direct...ors/api_util.py 0% 92% +92%
airbyte/mcp/_sso_auth.py 0% 96% +96%
airbyte/cloud/models.py 0% 96% +96%
airbyte/mcp/int...nc_status_ui.py 0% 97% +97%
airbyte/_direct...nnector_docs.py 0% 97% +97%
airbyte/mcp/agents.py 0% 98% +98%
airbyte/_direct...ctors/models.py 0% 99% +99%

Python / code-coverage/pytest-unit

The overall line coverage in commit 5ec956e in the cameron/fix-queued-j... branch is 73%. Line coverage data for the main branch is not yet available.

Show a line coverage summary of the most covered files.
File main cameron/fix-queued-j... 5ec956e +/-
airbyte/mcp/agents.py — 98% —
airbyte/mcp/_sso_auth.py — 96% —
airbyte/cloud/models.py — 95% —
airbyte/cloud/client.py — 91% —
airbyte/mcp/_otel.py — 89% —
airbyte/exceptions.py — 84% —
airbyte/progress.py — 80% —
airbyte/mcp/cloud.py — 71% —
airbyte/shared/...ql_processor.py — 68% —
airbyte/_util/api_util.py — 56% —

Updated October 06, 2026 00:07 UTC

@aaronsteers
Aaron ("AJ") Steers (aaronsteers) changed the base branch from main to release-candidate/v1 October 7, 2026 20:17
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) merged commit 069b839 into release-candidate/v1 Oct 7, 2026
33 checks passed
@aaronsteers
Aaron ("AJ") Steers (aaronsteers) deleted the cameron/fix-queued-job-status branch October 7, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants