Repository navigation
fix(low-code): skip dynamic streams when check reads only static streams - #1248
Conversation
|
I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".
|
👋 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/1792688475-check-skip-dynamic-streams#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/1792688475-check-skip-dynamic-streamsPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
Carry-over from the #1247 review: do this after #1247 is updated#1247 has a review with one blocker and several follow-ups. This PR is stacked on #1247's branch, and both PRs change
Carry-over
|
825f915 to
14a3757
Compare
|
Re: the carry-over comment: I've applied the list after rebasing onto #1247's review fix (1101804). The rebased D2 commit is
|
…eams Co-Authored-By: bot_apk <apk@cognition.ai>
Co-Authored-By: bot_apk <apk@cognition.ai>
14a3757 to
2a09438
Compare
|
/prerelease
|
Overview
👉 TL;DR: When a connection check tests only regular streams, it no longer looks up or sets up the connector's dynamically generated streams. As a result it makes no extra discovery requests, and problems with those generated streams appear at discover and sync time instead of failing the check.
Specifically, when every name is static,
ConcurrentDeclarativeSource._streams_by_nameno longer evaluatesself.dynamic_streamsand builds only the selected static configs, withall_configs=static_configs. Subclasses that overridestreams()and checks withdynamic_streams_check_configsstill go throughstreams().This PR is part of a stacked set:
Summary
PR 2 of the plan in the issue (D2). When every name
CheckStreamreads is a static stream,ConcurrentDeclarativeSource._streams_by_nameno longer evaluatesself.dynamic_streams: components resolvers are not built, resolver HTTP requests are not sent, and dynamic streams are not built.selected_configs = [c for c in static_configs if c.get("name") in selected_names] - + self.dynamic_streams -return self._create_streams(selected_configs, static_configs + dynamic_configs) +return self._create_streams(selected_configs, static_configs)Resolves https://github.com/airbytehq/airbyte-internal-issues/issues/17934:
Close on merge: no — internally filed, but the issue also asks for a benchmark row for each release; close once that row is added. (Second of two stacked PRs; #1247 is
Part of.)Rebased onto #1247's review fix: the
_uses_default_streams()guard stays first, so a subclass that overridesstreams()(e.g. source-google-ads) still goes through its override duringcheckand still resolves dynamic streams there.Behaviour change (D2, decided)
Duplicate dynamic stream names, a failing resolver request, or a dynamic stream that cannot be built no longer fail
checkwhen the checker reads only static streams.discoverandreadstill raise them. Per the issue, the affected manifests aresource-bing-ads,source-google-search-console,source-hubspot,source-linkedin-adsandsource-pinterest.Unchanged: a checked name that is a dynamic stream,
__airbyte_check_stream_namesnaming a non-static stream, and checkers withdynamic_streams_check_configsstill go throughstreams().use_cacherisk (accepted in the issue): parent names now come from static configs only, so a static stream read as a parent only by a dynamic stream no longer getsuse_cacheduringcheck. The request sent is the same.Releaser: paste into the release draft
If #1247 and #1248 ship in the same release, combine the two notes and drop #1247's "Dynamic streams are still resolved and built during
checkuntil #1248." sentence.Test Coverage
New tests in
unit_tests/sources/declarative/checks/test_check_stream.py:HttpComponentsResolverrequest (HttpMocker);checkSUCCEEDED,discoverraisesDynamic streams list contains a duplicate name;checkSUCCEEDED,discoverraises;dynamic_streams_check_configsstill evaluate the resolver; static-only checks evaluate it zero times;streams()still runs its override once and still sends the resolver request (fails without the override guard);checksucceeds,discoverraises.The first three fail on the PR 1 code.
unit_tests/sources/declarative,unit_tests/connector_builderand entrypoint tests pass locally (unit_tests/sources/declarative unit_tests/connector_builder: 2511 passed, 1 skipped); ruff and mypy clean.Declarative-First Evaluation
N/A — CDK framework change, not a connector manifest change.
Link to Devin session: https://app.devin.ai/sessions/328d83d551ec44219895b69f3d2f9bd3
Open in Devin Desktop: https://app.devin.ai/desktop/session/328d83d551ec44219895b69f3d2f9bd3?variant=devin