fix: add protocol override sync-check test and clarifying comment#950
Closed
Aldo Gonzalez (aldogonzalez8) wants to merge 1 commit intoaldo/scopes-array-schemafrom
Closed
Conversation
… scopes_join_strategy Co-Authored-By: aldo.gonzalez@airbyte.io <aldo.gonzalez@airbyte.io>
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
👋 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@devin/1773187863-protocol-override-safeguards#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 devin/1773187863-protocol-override-safeguardsPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
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.
This PR targets the following PR:
Summary
Adds two small safeguards for the protocol dataclass overrides introduced in #934:
Sync-check test — A parametrized test (
test_protocol_override_fields_in_sync) that introspects the 4 overridden dataclasses inairbyte_protocol.pyand asserts every field from the upstreamairbyte_protocol_dataclassespackage is present in the local override. This will fail on CI if the upstream package adds fields that the override doesn't include, preventing silent field loss at runtime.Clarifying comment — An inline comment on
scopes_join_strategy: Optional[str]explaining why this field is typed asstrin the protocol layer (notScopesJoinStrategyenum) — becausespec.pyconverts the enum to its.valuebefore serialization reaches this layer.Review & Testing Checklist for Human
import airbyte_protocol_dataclasses.modelsandimport airbyte_cdk.models.airbyte_protocolinside the test body to make the upstream-vs-override distinction explicit. Repo coding standards discourage inline imports; decide if this is acceptable for test clarity or if they should be moved to the top of the file.poetry run pytest unit_tests/sources/declarative/spec/test_spec.py -vand verify all 11 tests pass (4 new parametrized cases + 7 existing).Notes