feat(low-code): add UnionPartitionRouter component#1071
Draft
Daryna Ishchenko (darynaishchenko) wants to merge 3 commits into
Draft
feat(low-code): add UnionPartitionRouter component#1071Daryna Ishchenko (darynaishchenko) wants to merge 3 commits into
Daryna Ishchenko (darynaishchenko) wants to merge 3 commits into
Conversation
Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
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/1783689479-union-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 devin/1783689479-union-partition-routerPR Slash CommandsAirbyte Maintainers can execute the following slash commands on your PR:
|
…er additions Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
…rip for UnionPartitionRouter Co-Authored-By: Daryna Ishchenko <darina.ishchenko17@gmail.com>
2 tasks
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
Adds a new first-class declarative component,
UnionPartitionRouter, to unblock the source-github migration to manifest-only (see https://github.com/airbytehq/airbyte-internal-issues/issues/16492, https://github.com/airbytehq/airbyte-internal-issues/issues/16512 and airbytehq/airbyte#81428). It yields the deduplicated union of its child partition routers' slices, normalized to a single stable partition field:Behavior of
UnionPartitionRouter.stream_slices():partition_fieldvalue wins, later duplicates are skipped.{partition_field: value}; any other partition keys from a child (e.g.SubstreamPartitionRouter'sparent_slice) are moved intoextra_fields, so per-partition state keys stay stable regardless of which child produced the slice.get_stream_state()merges children's parent-stream states; request option methods return{}(children declaringrequest_optionare rejected at factory time — consume partition values viastream_partitioninterpolation instead). Note:CustomPartitionRouterchildren are opaque, so the request-option rejection cannot cover them.Wiring beyond the runtime class and schema:
create_union_partition_routerinModelToComponentFactory, registered inPYDANTIC_MODEL_TO_CONSTRUCTOR; schema registered inSimpleRetriever/AsyncRetrieverpartition_routeranyOf, with self-nesting allowed (minItems: 2).LegacyToPerPartitionStateMigrationacceptsUnionPartitionRouter:_get_partition_fieldreadspartition_fielddirectly, and the single-parent-stream check inshould_migratedoesn't apply.use_cacheauto-enable (_initialize_cache_for_parent_streams) and parent/ancestor dependency-graph collection (_collect_all_parent_stream_names,_collect_all_ancestor_names) now recurse into composed routers (partition_routers/underlying_partition_router).Tests:
use_cacheforce-enabled on all parents referenced through a union (including nested parent stream instances), and parent/ancestor collection detects deadlocks throughUnionPartitionRouterchildren, incl. a union nested insideGroupingPartitionRouter.Note on generated models:
poetry run poe assembleproduces the same ~350-line style drift (conint/confloat, class reordering) on a cleanmaincheckout in this environment, sodeclarative_component_schema.pywas hand-patched with only the UnionPartitionRouter additions to preserve the committed generated style.Link to Devin session: https://app.devin.ai/sessions/38753ed2d1f346e6a370888444676f4f
Requested by: Daryna Ishchenko (@darynaishchenko)