Repository navigation
feat(standard-tests): build sources that require catalog, config and state - #1232
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Draft
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Anatolii Yatsuk (tolik0) wants to merge 1 commit into
Conversation
…state The in-process Standard Tests called the connector class with no arguments. Python sources built on YamlDeclarativeSource, FileBasedSource or ConcurrentSourceAdapter require catalog, config and state, so every in-process test of those connectors failed with a TypeError before reaching the connector. That blocks running the suite in connector CI (airbyte-internal-issues #17133) for asana, freshcaller, google-ads, google-drive, microsoft-sharepoint, salesforce and sftp-bulk. create_connector() now inspects the signature and passes config from the scenario (an empty dict when there is none) and None for catalog and state, matching what run.py passes when it launches without them. Any other required argument raises a TypeError naming it, since the suite cannot guess it. An optional config also receives the scenario's config when there is one, as run.py passes --config. When the class accepts catalog, config or state, required or optional, its read is done by a source built from the read command's catalog, config and state, as run.py builds it. A file-based source takes its stream schemas from the catalog it is built with, so a source built without one fails every read with a missing json_schema error. A declarative Python source with an optional config (source-facebook-pages) evaluates the config in its components when it is built, so a source built without one sends requests with empty config values. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 14, 2026
👋 Greetings, Airbyte Team Member!Here are some helpful tips and reminders for your convenience. 💡 Show Tips and TricksTesting This CDK VersionYou can test this version of the CDK using the following: # Run the CLI from this branch:
uvx 'git+https://github.com/airbytehq/airbyte-python-cdk.git@tolik0/cdk/python-connector-test-support#egg=airbyte-python-cdk[dev]' --help
# Update a connector to use the CDK from this branch ref:
cd airbyte-integrations/connectors/source-example
poe use-cdk-branch tolik0/cdk/python-connector-test-supportPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
This was referenced Oct 14, 2026
| AirbyteStateMessage, | ||
| ConfiguredAirbyteCatalog, | ||
| ) | ||
| from airbyte_cdk.sources.source import Source |
PyTest Results (Fast)5 759 tests +11 5 728 ✅ +10 12m 54s ⏱️ +44s Results for commit 88a1d44. ± Comparison against base commit 2082c2d. This pull request skips 1 test. |
PyTest Results (Full)5 762 tests +11 5 731 ✅ +10 13m 29s ⏱️ - 3m 31s Results for commit 88a1d44. ± Comparison against base commit 2082c2d. This pull request skips 1 test. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The in-process Standard Tests (
SourceTestSuiteBase, used byairbyte-cdk connector testand bycreate_connector_test_suite()) now build Python sources the way theirrun.pydoes:create_connector()inspects the constructor (or factory) signature.catalog,configorstate, the suite passes the scenario's config (an empty dict when there is none) andNoneforcatalogandstate, asrun.pypasses them when it launches without a catalog or state.configalso gets the scenario's config, when the scenario has one, sincerun.pyalways passes--config.TypeErrorthat names it and says how to work around it.catalog,configorstate(required or optional), itsreadis done by a source built from thereadcommand's catalog, config and state, again asrun.pybuilds it.Why
The suite called the connector class with no arguments. Python sources built on
YamlDeclarativeSource,FileBasedSourceorConcurrentSourceAdapterrequirecatalog,configandstate, so every in-process test of those connectors failed with aTypeErrorbefore reaching the connector. This blocks running the suite in connector CI (airbytehq/airbyte-internal-issues#17133) for source-asana, source-freshcaller, source-google-ads, source-google-drive, source-microsoft-sharepoint, source-salesforce and source-sftp-bulk.Two kinds of source also need to be built with the command's own arguments:
json_schemaerror.config(source-facebook-pages) evaluates the config in its components when it is built. Built without one,checkandreadsend requests with empty config values.Verification
poetry run pytest unit_tests/test/ -p no:cacheprovider: 795 passed, 9 skipped. The new unit tests cover:readcommand;read.ruff format --check,ruff checkandmypy airbyte_cdk/testare clean.check, on its test credentials, which are known to be invalid (it already failsairbyte-cdk image test).Related PRs
This PR is part of airbytehq/airbyte-internal-issues#17133. It waits for no monorepo PR, and none of them waits for it: the new connector CI step runs each connector's pinned CDK, and the monorepo suite files build these sources themselves until a connector pins a release with this change.
integration_tests/standard_tests.pysuites for 14 sources. The 7 sources of its group 1 and source-facebook-pages (group 3) can delete theirs once they pin a release with this PR; the file-based sources of group 2 keep theirs, sinceFileBasedSourcealso requires a stream reader and a spec class.Migration
cdk-migrations.mdgets a new section under "Upgrading to the next minor release (unreleased)". No action is needed for most connectors. Connectors that overridecreate_connector()only to passcatalog,configandstatecan drop the override once they pin this release. The airbyte monorepo adds such overrides asintegration_tests/standard_tests.py(airbytehq/airbyte#88940).🤖 Generated with Claude Code