refactor: extract Dataset._build_pipeline() to eliminate 4x pipeline duplication#85
Merged
maxine-at-forecast merged 2 commits intodevelopfrom Apr 1, 2026
Conversation
…duplication [CL-L3] Consolidate the duplicated pipeline construction from ordered() and shuffled() (4 code paths) into a single _build_pipeline() method. Fix bug where batched iteration silently dropped filter/map stages — filter and map are now always applied per-sample before batching. Add eager validation for batch_size < 1 (previously raised a cryptic IndexError from WDS internals). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Dataset._build_pipeline()as single source of truth for pipeline construction, replacing 4 duplicated code paths inordered()/shuffled()filter()/map()stages — now applied per-sample before batchingValueErrorforbatch_size < 1(previously raised crypticIndexErrorfrom WDS internals)Test plan
ruff check)Closes CL-L3
🤖 Generated with Claude Code