Skip to content

Fix: Updated handling for Manifest-only connectors; Breaks: Remove Python 3.9 support#340

Merged
Aaron ("AJ") Steers (aaronsteers) merged 11 commits into
mainfrom
chore/manifest-only-connector-language
Aug 19, 2024
Merged

Fix: Updated handling for Manifest-only connectors; Breaks: Remove Python 3.9 support#340
Aaron ("AJ") Steers (aaronsteers) merged 11 commits into
mainfrom
chore/manifest-only-connector-language

Conversation

@aaronsteers

@aaronsteers Aaron ("AJ") Steers (aaronsteers) commented Aug 19, 2024

Copy link
Copy Markdown
Member

This fixes the language check to include the new 'manifest-only' language type, and it updates PyAirbyte to locate manifest yaml in their new directory.

This PR also requires dropping Python 3.9 support, as we've previously discussed in Slack. This is necessary in order to bump to the latest CDK version, which is necessary to install the latest manifest-only connectors.

Notes:

  • PyAirbyte always called these source_manifest connectors, so no rename is needed. "Low-code" and "manifest-only" are both the same category from the PyAirbyte user perspective.
  • The git refs can go away once we have manifests being published to GCS:
  • source-faker was previously a dev dependency, which created conflicts when trying to bump the CDK. This PR removes source-faker as a dev dependency and tests that rely on it will now auto-install the connector to complete their tests. This makes the diff much messier, but it is required in order to bump the CDK.

Summary by CodeRabbit

  • New Features

    • Enhanced the configurability of the DeclarativeExecutor by adding a name parameter for instance identification.
    • Introduced a mechanism for validating manifest structures to ensure compatibility with the executor.
  • Improvements

    • Simplified manifest retrieval logic, consolidating error handling and improving maintainability.
    • Updated integration tests to ensure the installation of sources when they are missing, enhancing test reliability.
    • Added a new label for better handling of connector metadata based on associated tags.
  • Updates

    • Minimum Python version requirement increased to 3.10, ensuring compatibility with newer features.
    • Adjusted dependency specifications for improved version management.
    • Updated GitHub Actions workflows to support only Python versions 3.10 and 3.11.

@coderabbitai

coderabbitai Bot commented Aug 19, 2024

Copy link
Copy Markdown
Contributor
Walkthrough

Walkthrough

The changes enhance the DeclarativeExecutor class's functionality, streamline the source manifest retrieval process, and update project dependencies for improved compatibility with Python 3.10. A new label for connector metadata expands the criteria for installation types, thereby improving the handling of various connector configurations. These updates contribute to a more robust and maintainable codebase, aligning with modern Python standards.

Changes

Files Change Summary
airbyte/_executors/declarative.py Added name parameter to DeclarativeExecutor and switched manifest reading to YAML. Introduced _validate_manifest for enhanced validation.
airbyte/_executors/util.py Added _try_get_source_manifest to simplify manifest retrieval. Streamlined get_connector_executor to handle source_manifest more efficiently.
airbyte/sources/registry.py Introduced _MANIFEST_ONLY_LABEL to improve metadata handling in connector installation logic.
pyproject.toml Updated minimum Python version from 3.9 to 3.10, adjusted airbyte-cdk dependency to "^4.5.1", and removed airbyte-source-faker.
tests/integration_tests/... Modified new_source_faker function to install the source if missing, changing behavior in integration tests.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant DeclarativeExecutor
    participant ManifestValidator
    participant SourceManifestRetriever
    
    User->>DeclarativeExecutor: Instantiate with name and manifest
    DeclarativeExecutor->>ManifestValidator: Validate manifest structure
    alt Validation successful
        ManifestValidator-->>DeclarativeExecutor: Validated
    else Validation error
        ManifestValidator-->>DeclarativeExecutor: Raise AirbyteConnectorInstallationError
    end
    DeclarativeExecutor->>SourceManifestRetriever: Retrieve source manifest
    SourceManifestRetriever-->>DeclarativeExecutor: Return manifest
Loading

Would you like to include any specific examples in the summaries, or do you think the current level of detail is sufficient? wdyt?


Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits

Files that changed from the base of the PR and between c65259a and d688938.

Files selected for processing (2)
  • tests/integration_tests/test_source_faker_integration.py (3 hunks)
  • tests/integration_tests/test_state_handling.py (2 hunks)
Files skipped from review due to trivial changes (1)
  • tests/integration_tests/test_state_handling.py
Files skipped from review as they are similar to previous changes (1)
  • tests/integration_tests/test_source_faker_integration.py

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Outside diff range, codebase verification and nitpick comments (1)
airbyte/_executors/declarative.py (1)

12-12: Consider converting JSON manifests to YAML

It seems there are JSON manifest files present in the repository, specifically in the tests/integration_tests/fixtures directory. Since you've switched to using YAML for manifest configuration, have you considered converting these JSON files to YAML to ensure compatibility? Additionally, it might be worth checking if any scripts or tools need updates to handle YAML instead of JSON. Wdyt?

  • tests/integration_tests/fixtures/valid_config.json
  • tests/integration_tests/fixtures/invalid_config.json
  • tests/integration_tests/fixtures/registry.json
Analysis chain

Consider the implications of switching to YAML.

You've switched from JSON to YAML for manifest configuration, which enhances flexibility. Have you ensured that all existing manifests are compatible with YAML, and have you considered the potential need for migration or conversion scripts? Wdyt?

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify if there are any JSON manifest files that might need conversion to YAML.

# Test: Search for JSON manifest files. Expect: No JSON manifest files.
fd --type f --extension json --exec echo "JSON manifest found: {}"

Length of output: 288

@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title Fix: Manifest-only connector updates Fix!: Updated handling for Manifest-only connectors; Breaks: Remove Python 3.9 support Aug 19, 2024
@aaronsteers Aaron ("AJ") Steers (aaronsteers) changed the title Fix!: Updated handling for Manifest-only connectors; Breaks: Remove Python 3.9 support Fix: Updated handling for Manifest-only connectors; Breaks: Remove Python 3.9 support Aug 19, 2024
@aaronsteers Aaron ("AJ") Steers (aaronsteers) deleted the chore/manifest-only-connector-language branch August 19, 2024 21:14

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

More a review for me to learn PyAirbyte than for confirming the change

def _validate_manifest(self, manifest_dict: dict) -> None:
"""Validate the manifest."""
manifest_text = json.dumps(manifest_dict)
if "class_name:" in manifest_text:

Choose a reason for hiding this comment

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

My understanding is that this means we don't support any connector with custom components. I think this is fair but there were some talks a while back to support custom components in the Connector Builder. I don't know where those talks are at today but it could be interesting for the marketplace team to know that such change will have an impact on PyAirbyte

# Source manifest is either a URL or a boolean (True)
source_manifest = _try_get_source_manifest(
source_name=name,
manifest_url=None if source_manifest is True else source_manifest,

Choose a reason for hiding this comment

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

I'm trying to figure out a bit more about PyAirbyte ; in which case get_connector_executor is called with source_manifest being a URL?

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.

2 participants