Repository navigation
fix(low-code): pass a custom component's decoder to its nested requester - #1212
Draft
devin-ai-integration[bot] wants to merge 2 commits into
Draft
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…ter, record selector and paginator Co-Authored-By: bot_apk <apk@cognition.ai>
Contributor
Author
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
devin-ai-integration
Bot
requested review from
Baz (bazarnov) and
Anatolii Yatsuk (tolik0)
October 6, 2026 15:13
👋 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/1791298668-custom-component-decoder-propagation#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/1791298668-custom-component-decoder-propagationPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Co-Authored-By: bot_apk <apk@cognition.ai>
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.
Summary
Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/17738:
Close on merge: yes — internally filed, no customer to confirm with.
Part of https://github.com/airbytehq/airbyte-internal-issues/issues/17702.
When a
CustomRetriever(or any custom component) declares adecoderfield, its nestedHttpRequester,RecordSelector/extractor and paginator were built independently bycreate_custom_componentand always fell back toJsonDecoder. SoHttpRequester.stream_responsewasFalseeven with a streaming decoder (e.g.JsonlDecoder→CompositeRawDecoder),requestsread the body eagerly, and the streaming decoder readingresponse.rawsilently yielded zero records.create_simple_retrieveralready builds the decoder first and passes it down; the custom-component path now does the same.Changes in
ModelToComponentFactory:create_custom_component: builds thedecoderfield first; if the component class declaresdecoderand it resolves to aDecoder, it is forwarded via kwargs to the nested subcomponents (nested_component_kwargs.setdefault("decoder", ...), so a decoder passed by a parent still wins).create_http_requester:decoderis now keyword-only andOptional(defaultNone→ freshJsonDecoder), so_create_nested_componentcan fill it like it already does forcreate_record_selector/create_default_paginator(pattern from fix(low-code): build session authenticators and paginators nested in SelectiveAuthenticator or custom components #500). This also removes the shared mutableJsonDecoderdefault. No positional callers exist in the CDK (create_simple_retrieverand the other callers passdecoder=).Unchanged: custom components without a
decoderfield (or with no decoder set) keep theJsonDecoderdefaults; underemit_connector_builder_messages=Truestreaming decoders are still downgraded to buffered, and the nested requester follows the same decoder (stream_response=False).This should let source-google-ads drop its workarounds (forcing
stream_response = TrueinGoogleAdsHttpRequesterand copying the decoder into the extractor inGoogleAdsRetriever.__post_init__) in a follow-up sub-issue; no connector change here.Reproduction
At
main(5381b8f) aSimpleRetrieversubclass withdecoder: Optional[Decoder]used as aCustomRetrieverwithdecoder: {type: JsonlDecoder}builtrequester.decoder = JsonDecoder,requester.stream_response = False,extractor.decoder = JsonDecoder. Against a local HTTP server returning 2 JSONL rows,CompositeRawDecoder(JsonLineParser(), stream_response=True).decode()yields[]for astream=Falseresponse and both rows forstream=True.Declarative-First Evaluation
Not applicable to a connector: this is a CDK factory fix, no custom component is added to any connector. The change makes the declarative
decoderfield on custom components behave like it does onSimpleRetriever, which reduces the need for custom-component workarounds.Test Coverage
New tests in
unit_tests/sources/declarative/parsers/test_model_to_component_factory.py(withTestingCustomRetrieverWithDecoderintesting_components.py):stream_response is True) and extractor (same instance)DefaultPaginatorJsonDecoderdefaults,stream_response Falsedecoderfield → manifest decoder is not propagatedThe propagation tests fail on the unfixed factory (
assert JsonDecoder() is CompositeRawDecoder(),assert False is True) and pass with the fix.Ran locally:
poetry run ruff check .,poetry run ruff format --check .,poetry run mypy --config-file mypy.ini airbyte_cdk/sources/declarative/parsers/model_to_component_factory.py,poetry run pytest unit_tests/sources/declarative unit_tests/connector_builder(2414 passed, 1 skipped), and the rest ofunit_tests/(1736 passed; 28 modules not collected locally only because optional extras — fastavro, fastapi, langchain_core, pyarrow, sqlalchemy, unstructured — aren't installed in this env; CI covers them).Requested via the
/ai-fixworkflow for the issue above (filed by Anatolii Yatsuk).Link to Devin session: https://app.devin.ai/sessions/d39a6ff2f24f44a691121ab965bf039c
Open in Devin Desktop: https://app.devin.ai/desktop/session/d39a6ff2f24f44a691121ab965bf039c?variant=devin