Skip to content

Add type annotations to Airbyte API, service, and schema#1328

Open
Harsh06-afk wants to merge 1 commit intoDalgoT4D:mainfrom
Harsh06-afk:issue-1015-airbyte-type-annotations
Open

Add type annotations to Airbyte API, service, and schema#1328
Harsh06-afk wants to merge 1 commit intoDalgoT4D:mainfrom
Harsh06-afk:issue-1015-airbyte-type-annotations

Conversation

@Harsh06-afk
Copy link
Copy Markdown

@Harsh06-afk Harsh06-afk commented May 3, 2026

Closes #1015

Changes

ddpui/ddpairbyte/schema.py
Added 14 new response schemas:

  • AirbyteSourceDefinition, AirbyteSourceRead
  • AirbyteDestinationDefinition, AirbyteDestinationRead
  • AirbyteSourceIdResponse, AirbyteDestinationIdResponse
  • AirbyteCheckConnectionResponse
  • AirbyteJobStatusResponse, AirbyteJobStatusWithoutLogsResponse
  • AirbyteSuccessResponse, AirbyteTaskResponse
  • AirbyteSyncHistoryItemResponse, AirbyteSyncHistoryResponse
  • AirbyteSchemaChangeResponse, AirbyteCancelJobResponse

ddpui/api/airbyte_api.py
Added response= type annotations to all 31 previously untyped endpoints.

ddpui/ddpairbyte/airbyte_service.py

  • Fixed incorrect return types: get_source_definitions, get_sources (List[Dict]dict),
    get_jobs_for_connection (int | Nonedict)
  • Added missing return types to: get_workspaces, delete_workspace, create_custom_source_definition,
    check_source_connection_for_update, check_destination_connection_for_update,
    get_current_airbyte_version

Summary by CodeRabbit

Release Notes

  • Refactor
    • Enhanced type safety and consistency across Airbyte API endpoints by adding explicit response schemas and type annotations to routes and service functions.
    • Introduced comprehensive response classes for sources, destinations, connections, jobs, sync history, and schema changes to ensure structured and predictable API responses.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 3, 2026

Walkthrough

This PR adds explicit type annotations to Airbyte API endpoints and service functions across three files. New response schema classes are defined, service functions receive return type hints, and API route decorators now declare their response schemas for type safety and documentation.

Changes

Type Annotation for Airbyte APIs and Services

Layer / File(s) Summary
Response Schemas
ddpui/ddpairbyte/schema.py
Introduces 17 new Airbyte response schema classes (AirbyteSourceDefinition, AirbyteSourceRead, AirbyteCheckConnectionResponse, AirbyteJobStatusResponse, AirbyteSyncHistoryResponse, etc.) with typed field definitions covering sources, destinations, connections, jobs, and status responses.
Service Function Types
ddpui/ddpairbyte/airbyte_service.py
Updates return type annotations on 8 functions (get_workspaces, delete_workspace, get_source_definitions, get_sources, check_source_connection_for_update, check_destination_connection_for_update, get_jobs_for_connection, get_current_airbyte_version); get_jobs_for_connection return type corrected from int | None to dict.
API Route Decorators
ddpui/api/airbyte_api.py
Expands imports of Airbyte schema classes and adds explicit response= declarations to 26 route decorators across source definitions, sources, destinations, jobs, v1 connections, sync history, schema changes, logs, and cancel endpoints.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • #1117: Makes identical changes to ddpui/api/airbyte_api.py response decorators and expands ddpui/ddpairbyte/schema.py with the same Airbyte response models.

Suggested reviewers

  • fatchat
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding type annotations to Airbyte API, service, and schema files, which aligns with all modifications in the changeset.
Linked Issues check ✅ Passed The PR comprehensively addresses issue #1015 objectives: annotated all 31 Airbyte API endpoints with response schemas, added 14 new schema classes, and corrected function return types in airbyte_service.py.
Out of Scope Changes check ✅ Passed All changes are in scope and directly address issue #1015 requirements: type annotations for APIs, services, and schemas with no unrelated modifications present.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
Review rate limit: 0/1 reviews remaining, refill in 60 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
ddpui/ddpairbyte/airbyte_service.py (1)

1122-1130: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove the stray debug print.

print() here bypasses the project logger and will leak every version lookup to stdout. Please switch this to logger.debug(...) or remove it entirely.

♻️ Suggested fix
-    print(res, "AIRBYTE RESPONSE")
+    logger.debug("AIRBYTE RESPONSE: %s", res)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ddpui/ddpairbyte/airbyte_service.py` around lines 1122 - 1130, The stray
print in get_current_airbyte_version prints sensitive info to stdout; replace
the print(res, "AIRBYTE RESPONSE") with a logger.debug call or remove it
entirely so version lookups use the project's logger. Update the call near
get_current_airbyte_version (and any similar debug prints around abreq usage) to
use logger.debug(...) with a concise message and the res variable if needed.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Outside diff comments:
In `@ddpui/ddpairbyte/airbyte_service.py`:
- Around line 1122-1130: The stray print in get_current_airbyte_version prints
sensitive info to stdout; replace the print(res, "AIRBYTE RESPONSE") with a
logger.debug call or remove it entirely so version lookups use the project's
logger. Update the call near get_current_airbyte_version (and any similar debug
prints around abreq usage) to use logger.debug(...) with a concise message and
the res variable if needed.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: e8561921-fb74-4c36-8601-56e52d8d369a

📥 Commits

Reviewing files that changed from the base of the PR and between 94269f6 and 2c9a158.

📒 Files selected for processing (3)
  • ddpui/api/airbyte_api.py
  • ddpui/ddpairbyte/airbyte_service.py
  • ddpui/ddpairbyte/schema.py

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.

Type annotate airbyte api, services & core functions

2 participants