Skip to content

feat: Add unprivileged and config-free discover for declarative static schemas #559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

aaronsteers
Copy link
Contributor

@aaronsteers aaronsteers commented May 20, 2025

What

Introduces new behavior to attempt discovery even if config is omitted. Tested successfully with source-pokeapi.

Replaces the Devin-created PRs:

Important

  • Some connectors will not succeed their discover in practice, even though they could complete it in theory. For example, I tested the below sample run with klaviyo in place of pokeapi, and the Klaviyo source tries to access api_key from config during initialization of its custom components. The problem lies in the fact that discover has to call streams(), which tries to fully initialize all Stream objects.

TODO

  • I'm working through some downstream failures in connectors. Several appear to be related to the tests execting failure but getting success instead.

Future Improvements

Further future improvements could be made which delivers one or more of the following:

  1. Introduce a mode where errors in the streams() method are treated as warnings and not fatal errors.
  2. Introduce a mode where a code path besides streams() is used for discovery.
  3. Modify connector logic to evaluate lazily, so that discover would not fail (for instance) but check or read would fail.

Sample successful run:

$ poetry run source-declarative-manifest discover \
  --manifest-path=../airbyte/airbyte-integrations/connectors/source-pokeapi/manifest.yaml  
{"type":"CATALOG","catalog":{"streams":[{"name":"pokemon","json_schema":{"type":"object","$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":true,"properties":{"abilities":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"ability":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"is_hidden":{"type":["null","boolean"]},"slot":{"type":["null","integer"]}}}},"base_experience":{"type":["null","integer"]},"forms":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}}},"game_indices":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"version":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"game_index":{"type":["null","integer"]}}}},"height":{"type":["null","integer"]},"held_items":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"item":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"version_details":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"version":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"rarity":{"type":["null","integer"]}}}}}}},"id":{"type":["null","integer"]},"is_default":{"type":["null","boolean"]},"location_area_encounters":{"type":["null","string"]},"moves":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"move":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"version_group_details":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"level_learned_at":{"type":["null","integer"]},"move_learn_method":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"version_group":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}}}}}}}},"name":{"type":["null","string"]},"order":{"type":["null","integer"]},"past_types":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"generation":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"types":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"type":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"slot":{"type":["null","integer"]}}}}}}},"species":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"sprites":{"type":["null","object"],"additionalProperties":true,"properties":{"back_default":{"type":["null","string"]},"back_female":{"type":["null","string"]},"back_shiny":{"type":["null","string"]},"back_shiny_female":{"type":["null","string"]},"front_default":{"type":["null","string"]},"front_female":{"type":["null","string"]},"front_shiny":{"type":["null","string"]},"front_shiny_female":{"type":["null","string"]}}},"stats":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"base_stat":{"type":["null","integer"]},"effort":{"type":["null","integer"]},"stat":{"type":["null","object"],"additionalProperties":true,"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}}}}},"types":{"type":["null","array"],"items":{"type":["null","object"],"additionalProperties":true,"properties":{"type":{"type":["null","object"],"properties":{"name":{"type":["null","string"]},"url":{"type":["null","string"]}}},"slot":{"type":["null","integer"]}}}},"weight":{"type":["null","integer"]}}},"supported_sync_modes":["full_refresh"],"source_defined_primary_key":[["id"]],"is_resumable":false,"is_file_based":false}]}}

Summary by CodeRabbit

Summary by CodeRabbit

  • New Features
    • Added support for running discovery without a configuration file for sources that support unprivileged discovery, controlled by a new flag.
  • Bug Fixes
    • Improved handling of missing or empty configuration during discovery to prevent errors.
  • Tests
    • Introduced new tests to verify discovery behavior with and without dynamic schema loaders.
    • Updated existing tests to align with the new optional config behavior for discovery.
  • Chores
    • Enhanced test suite to skip discovery tests when exceptions are expected.

devin-ai-integration bot and others added 21 commits April 8, 2025 22:33
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
@github-actions github-actions bot added the enhancement New feature or request label May 20, 2025
@aaronsteers aaronsteers marked this pull request as ready for review May 20, 2025 03:11
Copy link
Contributor

coderabbitai bot commented May 20, 2025

📝 Walkthrough

Walkthrough

This update introduces a mechanism for sources to optionally skip configuration validation during the discovery phase, controlled by a new check_config_during_discover flag. The flag is now part of the BaseConnector interface and is set dynamically in ManifestDeclarativeSource based on the use of a DynamicSchemaLoader. The CLI and entrypoint logic are updated to support discovery without requiring a config file when permitted. Corresponding unit tests validate these behaviors. Additionally, some tests were adjusted to reflect the optional nature of the config argument for discovery, and a test skip was added for expected exceptions during discovery. A minor fix was made to ensure config defaults to an empty dictionary instead of None in a CLI helper function.

Changes

File(s) Change Summary
airbyte_cdk/connector.py Added check_config_during_discover: bool = True attribute with docstring to BaseConnector. Added docstring to existing check_config_against_spec attribute.
airbyte_cdk/entrypoint.py Made --config argument optional for discover command. Updated run method to allow discovery without config when check_config_during_discover is False, using empty config. Changed discovery validation to use check_config_during_discover instead of check_config_against_spec.
airbyte_cdk/cli/source_declarative_manifest/_run.py Modified _parse_inputs_into_config_catalog_state to default config to {} instead of None when missing or falsy in parsed arguments.
airbyte_cdk/sources/declarative/manifest_declarative_source.py Added instance attribute check_config_during_discover initialized in constructor based on presence of DynamicSchemaLoader in streams. Added private method _uses_dynamic_schema_loader() to detect dynamic schema loader usage.
unit_tests/sources/declarative/test_manifest_declarative_source_dynamic_schema.py New test module verifying check_config_during_discover behavior in ManifestDeclarativeSource with and without DynamicSchemaLoader. Tests discovery with and without config, asserting correct catalog streams and flag states.
unit_tests/test_entrypoint.py Removed "discover" command from parameterized test test_parse_missing_required_args to reflect that config is no longer required for discovery.
airbyte_cdk/test/standard_tests/source_base.py Added import of pytest. Modified test_discover to skip test if scenario expects exception. Added early returns in test_basic_read when exceptions expected during check or discover. Added assertion failure if expected exception does not occur after read.
airbyte_cdk/test/standard_tests/_job_runner.py Removed assertion that an exception must be raised when expected for verbs other than "check". Now returns result regardless of errors if exception expected.
airbyte_cdk/test/standard_tests/connector_base.py Adjusted imports for connection status models. Used connection_status_messages attribute in test_check. Added assertion error if test scenario expects exception but connection status is succeeded without errors.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI/Entrypoint
    participant Source
    participant SchemaLoader

    User->>CLI/Entrypoint: Run `discover` (with or without --config)
    CLI/Entrypoint->>Source: Check check_config_during_discover
    alt check_config_during_discover is True
        CLI/Entrypoint->>Source: Validate config
        Source->>CLI/Entrypoint: Validation result
        CLI/Entrypoint->>Source: Call discover(config)
    else check_config_during_discover is False
        CLI/Entrypoint->>Source: Call discover({}) (empty config)
    end
    Source->>SchemaLoader: (if stream uses DynamicSchemaLoader) Load schema
    SchemaLoader-->>Source: Schema
    Source->>CLI/Entrypoint: Discovery messages
    CLI/Entrypoint->>User: Output discovery results
Loading

Would you like me to create a separate sequence diagram illustrating the dynamic schema loader detection logic inside ManifestDeclarativeSource? Or is this overview sufficient for your needs? Wdyt?

Note

⚡️ AI Code Reviews for VS Code, Cursor, Windsurf

CodeRabbit now has a plugin for VS Code, Cursor and Windsurf. This brings AI code reviews directly in the code editor. Each commit is reviewed immediately, finding bugs before the PR is raised. Seamless context handoff to your AI code agent ensures that you can easily incorporate review feedback.
Learn more here.


Note

⚡️ Faster reviews with caching

CodeRabbit now supports caching for code and dependencies, helping speed up reviews. This means quicker feedback, reduced wait times, and a smoother review experience overall. Cached data is encrypted and stored securely. This feature will be automatically enabled for all accounts on May 16th. To opt out, configure Review - Disable Cache at either the organization or repository level. If you prefer to disable all data retention across your organization, simply turn off the Data Retention setting under your Organization Settings.
Enjoy the performance boost—your workflow just got faster.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between c8dd910 and dd94e86.

📒 Files selected for processing (3)
  • airbyte_cdk/test/standard_tests/_job_runner.py (1 hunks)
  • airbyte_cdk/test/standard_tests/connector_base.py (2 hunks)
  • airbyte_cdk/test/standard_tests/source_base.py (5 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • airbyte_cdk/test/standard_tests/source_base.py
🧰 Additional context used
🧬 Code Graph Analysis (2)
airbyte_cdk/test/standard_tests/_job_runner.py (2)
airbyte_cdk/test/standard_tests/models/scenario.py (1)
  • expect_exception (72-73)
airbyte_cdk/test/entrypoint_wrapper.py (1)
  • errors (113-114)
airbyte_cdk/test/standard_tests/connector_base.py (2)
airbyte_cdk/test/entrypoint_wrapper.py (2)
  • connection_status_messages (90-91)
  • errors (113-114)
airbyte_cdk/test/standard_tests/models/scenario.py (1)
  • expect_exception (72-73)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Analyze (python)
🔇 Additional comments (5)
airbyte_cdk/test/standard_tests/_job_runner.py (1)

151-154: Simplified error assertion logic

The code now only validates that no errors occur when exceptions aren't expected, removing what was likely an assertion enforcing errors when exceptions are expected. This makes the code more flexible for scenarios like config-free discovery where certain exceptions might be expected but not strictly enforced.

Is this intentional to support the unprivileged discovery feature? It seems aligned with your PR goals of allowing discovery to attempt to proceed even when config parameters are omitted, wdyt?

airbyte_cdk/test/standard_tests/connector_base.py (4)

16-17: Updated imports for better protocol handling

You've switched from importing AirbyteMessage and Type to using AirbyteConnectionStatus from protocol dataclasses and Status from models. This is a nice refinement that makes the types more specific and aligns with the protocol-based approach.

Also applies to: 19-19


118-124: Enhanced error messages for failed assertions

The improved assertion message now includes both the connection status messages and detailed error information. This will make debugging much easier when tests fail.


125-127: Explicit type casting for connection status

You've added explicit type casting to AirbyteConnectionStatus, which helps with type safety and IDE suggestions. Nice improvement!


128-133: Added verification for expected exceptions

This new check catches a potential edge case: when a test expects to fail but actually succeeds. This is particularly important for your config-free discovery feature - we want to make sure a connector that should fail without config doesn't silently succeed in unexpected ways.

This is a thoughtful addition that ensures expected behavior is properly enforced. Nice job!

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 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 explain this code block.
    • @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 gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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 using 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 generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this 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.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

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.

Copy link
Contributor

@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.

Actionable comments posted: 1

🧹 Nitpick comments (4)
unit_tests/sources/declarative/test_manifest_declarative_source_dynamic_schema.py (3)

7-14: Trim unused imports to avoid linter noise, wdyt?

pytest and check_config_against_spec_or_exit are imported but never referenced in this module. Removing them keeps the test file lean and prevents future flake8/ruff warnings.

-from unittest.mock import MagicMock, patch
-
-import pytest
-
-from airbyte_cdk.models import AirbyteCatalog
-from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource
-from airbyte_cdk.sources.utils.schema_helpers import check_config_against_spec_or_exit
+from unittest.mock import MagicMock, patch
+
+from airbyte_cdk.models import AirbyteCatalog
+from airbyte_cdk.sources.declarative.manifest_declarative_source import ManifestDeclarativeSource

16-43: Collapse almost-identical configs with @pytest.mark.parametrize?

Both tests build large, nearly identical source_config dicts that differ only by the schema_loader type and the expected boolean flag. Switching to a single parametrized test would reduce duplication and make the intent clearer:

@pytest.mark.parametrize(
    "schema_loader, expected_flag",
    [
        ({"type": "DynamicSchemaLoader", ...}, True),
        ({"type": "InlineSchemaLoader", "schema": {}}, False),
    ],
)
def test_check_config_during_discover(schema_loader, expected_flag):
    source_config = {... "schema_loader": schema_loader, ...}
    source = ManifestDeclarativeSource(source_config=source_config)
    assert source.check_config_during_discover is expected_flag
    assert source.check_config_against_spec is True

This keeps the focus on the behavior being exercised rather than on the boilerplate fixture, wdyt?

Also applies to: 52-68


84-87: Simplify mock stream name assignment for clarity

Setting the name via type(mock_airbyte_stream).name = "test_dynamic_stream" works but is slightly cryptic. Assigning the attribute directly on the instance is more obvious:

-mock_airbyte_stream = MagicMock()
-type(mock_airbyte_stream).name = "test_dynamic_stream"
+mock_airbyte_stream = MagicMock()
+mock_airbyte_stream.name = "test_dynamic_stream"

Unless there’s a strict need for the attribute to live on the class, the direct instance assignment is easier to read, wdyt?

airbyte_cdk/entrypoint.py (1)

106-110: CLI UX: optional flag still listed under “required” group

--config is no longer required for discover, but it’s still added to the “required named arguments” group. This can mislead users reading --help. Would moving it to the parent parser (or renaming the group) be clearer?

-required_discover_parser = discover_parser.add_argument_group("required named arguments")
-required_discover_parser.add_argument(
+discover_parser.add_argument(
     "--config", type=str, required=False, help="path to the json configuration file"
 )
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between d458e8f and fac853c.

📒 Files selected for processing (6)
  • airbyte_cdk/cli/source_declarative_manifest/_run.py (1 hunks)
  • airbyte_cdk/connector.py (1 hunks)
  • airbyte_cdk/entrypoint.py (3 hunks)
  • airbyte_cdk/sources/declarative/manifest_declarative_source.py (3 hunks)
  • unit_tests/sources/declarative/test_manifest_declarative_source_dynamic_schema.py (1 hunks)
  • unit_tests/test_entrypoint.py (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
🔇 Additional comments (6)
airbyte_cdk/connector.py (1)

35-42: Documentation for config validation control flags is clear and well-placed.

The docstrings for both check_config_against_spec and check_config_during_discover clearly explain their purpose and behavior. The new flag allows sources to provide catalog information without requiring authentication, which is a useful extension.

airbyte_cdk/cli/source_declarative_manifest/_run.py (1)

238-239: Good change to avoid None for config.

This change ensures that config is always a dictionary (possibly empty) rather than None when no valid config argument is provided, which makes downstream processing more consistent. This supports the new unprivileged discovery flow.

unit_tests/test_entrypoint.py (1)

246-246: Test updated correctly to reflect optional config for discover.

The test definition has been properly updated to reflect the fact that the "discover" command no longer requires a config parameter. This aligns with the changes in the entrypoint implementation.

airbyte_cdk/sources/declarative/manifest_declarative_source.py (2)

143-144: Good pattern for setting check_config_during_discover based on schema loader type.

Setting this flag based on the presence of a DynamicSchemaLoader is a clean approach that automatically enables the appropriate behavior without requiring manual configuration for each source.


549-579: Well-implemented schema loader detection method.

The _uses_dynamic_schema_loader method is thorough, checking both static streams and dynamic stream templates. The documentation is clear about its purpose and return value.

I particularly appreciate the detailed checks that handle nested configurations and the various ways streams can be defined in the manifest.

airbyte_cdk/entrypoint.py (1)

278-282: Double-check backwards compatibility of the new gate

discover() now validates config only when check_config_during_discover is True. For connectors that never define the flag (older versions), the default value on BaseConnector will govern behavior. Could you confirm that default is True to preserve existing semantics? If not, adding an explicit default here might avoid accidental skips, wdyt?

@aaronsteers aaronsteers changed the title feat: Add unprivileged discover for declarative static schemas feat: Add unprivileged and config-free discover for declarative static schemas May 20, 2025
Copy link
Contributor

@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.

Actionable comments posted: 0

🧹 Nitpick comments (1)
airbyte_cdk/test/standard_tests/source_base.py (1)

63-66: Conditionally skipping discover test makes sense, but worth considering consistency with test_basic_read approach - wdyt?

This addition properly skips the discover test when an exception is expected, which aligns with the PR objective of supporting unprivileged discovery for static schemas.

I noticed that in test_basic_read (lines 108-115), there's a different approach - the test runs and then asserts that errors are present when scenario.expect_exception is true. Both approaches are valid, but having different patterns might be confusing to future contributors.

Would it make sense to either:

  1. Use the same pattern in both methods (either skip or expect errors), or
  2. Add a comment explaining why different approaches are used?
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 9b37bc5 and 640c811.

📒 Files selected for processing (1)
  • airbyte_cdk/test/standard_tests/source_base.py (2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
airbyte_cdk/test/standard_tests/source_base.py (1)
airbyte_cdk/test/standard_tests/models/scenario.py (1)
  • expect_exception (72-73)
⏰ Context from checks skipped due to timeout of 90000ms (9)
  • GitHub Check: Check: 'source-pokeapi' (skip=false)
  • GitHub Check: Check: 'source-amplitude' (skip=false)
  • GitHub Check: Check: 'source-hardcoded-records' (skip=false)
  • GitHub Check: Check: 'source-shopify' (skip=false)
  • GitHub Check: Pytest (All, Python 3.10, Ubuntu)
  • GitHub Check: Pytest (All, Python 3.11, Ubuntu)
  • GitHub Check: SDM Docker Image Build
  • GitHub Check: Pytest (Fast)
  • GitHub Check: Analyze (python)
🔇 Additional comments (1)
airbyte_cdk/test/standard_tests/source_base.py (1)

6-6: Import addition looks good.

The addition of the pytest import is necessary to support the new test skip functionality. Clean and straightforward.

@aaronsteers
Copy link
Contributor Author

aaronsteers commented May 20, 2025

/autofix

Auto-Fix Job Info

This job attempts to auto-fix any linting or formating issues. If any fixes are made,
those changes will be automatically committed and pushed back to the PR.

Note: This job can only be run by maintainers. On PRs from forks, this command requires
that the PR author has enabled the Allow edits from maintainers option.

PR auto-fix job started... Check job output.

✅ Changes applied successfully.

@@ -261,7 +279,7 @@ def discover(
self, source_spec: ConnectorSpecification, config: TConfig
) -> Iterable[AirbyteMessage]:
self.set_up_secret_filter(config, source_spec.connectionSpecification)
if self.source.check_config_against_spec:
if self.source.check_config_during_discover:
Copy link
Contributor

Choose a reason for hiding this comment

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

❓ Am I reading this right that this is a manifest level flag? Should it be a spec level definition instead?

Copy link
Contributor Author

@aaronsteers aaronsteers May 20, 2025

Choose a reason for hiding this comment

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

@bnchrch - I will think through this a bit more. As of now, it is a property of the connector base class as of now (defaulting to requiring check), overwritten by Declarative source to not require by default.

I think the desired behavior is that for declarative sources, we'd not validate config unless dynamic schemas are needed.

Copy link
Contributor

Choose a reason for hiding this comment

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

Happy to approve if this is useful for this area.

Certainly would be great to enable for all connectors via something in the spec though

Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like it would take too much to add a proposal

@aaronsteers
Copy link
Contributor Author

aaronsteers commented May 20, 2025

Note:

  • I'm working through some downstream failures in connectors. Some (maybe not all) appear to be related to the tests expecting failure but getting success instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants