feat: add ClientSideIncrementalRetrieverDecorator for custom retrievers #893
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
Fixes a gap where custom retrievers bypass client-side incremental filtering even when
is_client_side_incremental: trueis configured in the manifest.Problem: When a stream uses a custom retriever (not
SimpleRetriever), theClientSideIncrementalRecordFilterDecoratorthat normally filters records based on cursor state is never applied. This causes all records to be emitted on every sync, defeating the purpose of incremental syncing.Solution: Add a new
ClientSideIncrementalRetrieverDecoratorthat wraps custom retrievers at the retriever level (rather than record filter level) and applies the same filtering logic usingcursor.should_be_synced().Changes:
ClientSideIncrementalRetrieverDecoratorclass inretrievers/create_default_stream()inmodel_to_component_factory.pyto wrap custom retrievers when:is_client_side_incrementalis enabledSimpleRetriever(which already handles this via record filter)FinalStateCursor(i.e., there's actual incremental state)Related to: airbytehq/oncall#11113
Review & Testing Checklist for Human
elifbranch increate_default_stream()correctly excludesAsyncRetriever(handled in theifbranch above) andSimpleRetriever(already has filtering)is_client_side_incremental: trueto verify end-to-end behaviorMappingis received, aRecordis created withstream_name=""- verify this doesn't cause issues with cursor implementationsNotes