Shuffler extractor - #499
Open
andrewdalpino wants to merge 2 commits into
Open
andrewdalpino wants to merge 2 commits into
andrewdalpino wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Validate non-positive bufferSize values and correct the documented constructor type.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
Adds a bounded-buffer Shuffler extractor for streaming record randomization.
Changes:
- Implements buffered Fisher–Yates-style shuffling.
- Adds deterministic behavior and preservation tests.
- Documents the extractor and adds it to navigation.
File summaries
| File | Summary |
|---|---|
tests/Extractors/ShufflerTest.php |
Adds shuffle behavior tests. |
src/Extractors/Shuffler.php |
Adds the streaming shuffler implementation; bufferSize validation is required. |
mkdocs.yml |
Registers the documentation page. |
docs/extractors/shuffler.md |
Documents the extractor; update the parameter type from Traversable to iterable. |
Review details
Suppressed comments (1)
docs/extractors/shuffler.md:16
- The constructor declares
iterable $iteratorand the accompanying test passes a plain array, but this parameter table advertisesTraversable. That omits a valid input form from the new class's public documentation; please change this type toiterableto match the signature.
| 1 | iterator | | Traversable | The base iterator. |
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+47
to
+51
| public function __construct(iterable $iterator, int $bufferSize = 256) | ||
| { | ||
| $this->iterator = $iterator; | ||
| $this->bufferSize = $bufferSize; | ||
| } |
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.
Shuffle records as they are streaming using Fisher-Yates sampling.