fix(low-code): send HttpComponentsResolver partition router request options and support AsyncRetriever - #1195
Conversation
…ptions and support AsyncRetriever
👋 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@bazarnov/fix-http-components-resolver-partition-router#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 bazarnov/fix-http-components-resolver-partition-routerPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Daryna Ishchenko (darynaishchenko)
left a comment
There was a problem hiding this comment.
Approving. The wiring matches create_default_stream, and I probed 8 resolver shapes at this head vs main: the three monorepo users (airtable, google-sheets, hubspot — Substream/no router, no request_option) send identical requests and resolve the same streams; router request_options are sent per partition again as in 6.x; an AsyncRetriever resolver creates/polls/downloads a job where main raises KeyError: 'requester'; failed/timeout jobs during discover raise a traced system_error and free their tracker slots. Both new tests fail on main, and 4 of 5 production hunks are killed by a mutation (the legacy guard is the known exception).
One inline note on the release surface for the key-collision case — it is a scan plus a sentence, not a code change.
Summary
create_http_components_resolverbuilds the resolver retriever with only the pre-#707stream_slicer=kwarg. Since #707 (v7.0.0),create_simple_retrievertakes the partition router aspartition_routerand uses it as the request options provider, so:request_optionon the resolver retriever's partition router is silently dropped.AsyncRetrieverresolver retriever, which the schema allows, fails discovery withKeyError: 'requester'(theuse_cacheoverride). Past that, the resolver iterates the partition router instead of the job slices and would treat the slice log message as component values.Changes
create_http_components_resolverbuilds the partition router once and passes it asstream_slicerandpartition_router, likecreate_default_stream. The resolver iterates the same instance, or theAsyncRetriever's job slicer.HttpComponentsResolver.resolve_componentsskipsAirbyteMessageitems (theAsyncRetrieverslice log), asDynamicSchemaLoaderdoes since fix(low-code): support AsyncRetriever in DynamicSchemaLoader #974.ConcurrentDeclarativeSourceand the legacyManifestDeclarativeSourcesetuse_cacheonly on a resolver retriever that has arequester. Async job requesters stay uncached, so polling never replays a stale job status.Compatibility
HttpComponentsResolver(source-airtable, source-google-sheets, source-hubspot), all with aSimpleRetrieverand norequest_optionon its partition router. Their resolver requests (method, URL, headers, body) are identical onmainand on this branch, and the resolved streams are the same.request_optionon the resolver retriever's partition router send it again, as before v7.0.0. If the requester also sets the same key,combine_mappingsnow raises on the duplicate, andignore_stream_slicer_parameters_on_paginated_requestsnow applies.AsyncRetrieverresolver is not cached, so each resolution creates a job.checkand the Connector Builder resolve twice per process, so they create two jobs, asDynamicSchemaLoaderwith anAsyncRetrieverdoes (fix(low-code): support AsyncRetriever in DynamicSchemaLoader #974).Tests
In
resolvers/test_http_components_resolver.py, end to end throughConcurrentDeclarativeSourceandHttpMocker:test_dynamic_streams_with_http_components_resolver_partition_router_request_option: the resolver request carries?p=p1.test_dynamic_streams_with_http_components_resolver_async_retriever: creates, polls and downloads a job. The resolved streams areitem_1anditem_2, with none from the slice log.Both fail on
main. A mutation of each change on theConcurrentDeclarativeSourcepath fails at least one of them. The legacyuse_cacheguard is the same one-line change and has no test of its own.unit_tests/sources/declarative/{resolvers,parsers,retrievers,schema}andunit_tests/legacy: 717 passed.Release note
Dynamic-stream resolvers send their partition router's
request_optionagain, as before 7.0.0. If a resolver's requester hard-codes the same key inrequest_parameters,request_headersorrequest_body_json, remove it from the requester.Fixes #1181