fix: raise a clear error when ValidSplit gets an IterableDataset - #1151
Merged
BenjaminBossan merged 3 commits intoAug 10, 2026
Merged
Conversation
BenjaminBossan
requested changes
Aug 6, 2026
BenjaminBossan
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the PR. I made a suggestion, please check.
BenjaminBossan
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the update, just one question.
BenjaminBossan
approved these changes
Aug 10, 2026
BenjaminBossan
left a comment
Collaborator
There was a problem hiding this comment.
Thanks for the update, LGTM.
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.
Closes #594.
ValidSplitneedslen()andSubset, so anIterableDatasetcurrently dies with an opaqueTypeErrorabout a missing length. It now raises aValueErrornaming the cause and pointing attrain_split=None.Per the request on the issue that the error only be raised if really needed, the check sits in
ValidSplit.__call__rather than inNeuralNet- a customtrain_splitthat tolerates anIterableDatasetkeeps working, and there is a test covering that.Review fixes applied
TypeErrorfromget_leninstead of checkingisinstanceup front, so anIterableDatasetsubclass that defines__len__still splits normally; any other error is reraised untouched. Added a test for that case.TypeError(from excinstead offrom None) so the traceback keeps it; test asserts__cause__.