Feat: Batch transform support (BatchTransformerInterface)#60
Merged
Feat: Batch transform support (BatchTransformerInterface)#60
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #60 +/- ##
===========================================
Coverage 100.00% 100.00%
- Complexity 352 372 +20
===========================================
Files 61 62 +1
Lines 916 966 +50
===========================================
+ Hits 916 966 +50 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Allow transforming multiple items at once instead of one-by-one, enabling use cases like concurrent HTTP requests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
f5662a5 to
c92c636
Compare
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
BatchTransformerInterface— a new interface (separate fromTransformerInterface) for transforming items in batches instead of one-by-oneCallableBatchTransformer— callable-based implementationbatchSizeoption toEtlConfigurationto control chunk sizeIterableProcessorto chunk extracted items viaiterable_chunk()when a batch transformer is detectedprocessItemBatch()toEtlExecutorfor batch processing orchestrationbentools/iterable-functionsfromrequire-devtorequireUse case
Transformers that make HTTP calls can now send N requests concurrently instead of waiting for each response sequentially:
Design decisions
BatchTransformerInterfacedoes not extendTransformerInterface(PHP prevents parameter type narrowingmixed→array)BatchTransformerInterface(regardless ofbatchSize)nextTickcallbacks are consumed between batches, not between items within a batchSkipRequestduring extraction removes the item from the batch;StopRequestprocesses collected items then stopsBatchTransformerInterface,batchSizeis ignored (zero behavioral change)Test plan
🤖 Generated with Claude Code