Handle type conversion errors in FilterByValueBlock#78
Merged
russellb merged 2 commits intoinstructlab:mainfrom Jul 6, 2024
Merged
Handle type conversion errors in FilterByValueBlock#78russellb merged 2 commits intoinstructlab:mainfrom
russellb merged 2 commits intoinstructlab:mainfrom
Conversation
The previous code in this block did filtering assuming that all samples had a value that was correct for the type. For example, when filtering on an integer value, it assumed every row had a valid integer, where it may instead have garbage. This change introduces a new helper, _convert_dtype(), which properly handles this condition. When the conversion fails on a `ValueError` exception, it treats it as `None` instead of allowing the exception to be raised up to the caller. The fix was authored by Shiv in PR instructlab#72. I only pulled it out into a standalone commit. Signed-off-by: Russell Bryant <rbryant@redhat.com> Co-authored-by: shiv <shivchander.s30@gmail.com>
Closed
Contributor
Author
|
I posted this as part of a discussion thread here: #72 (comment) |
markmc
reviewed
Jul 4, 2024
Contributor
|
Great, very clear. Well done on adding tests. lgtm |
This new file introduces some unit tests for the filterblock module. A previous commit introduced a bug fix to ensure that unexpected data does not cause this block to break. These tests exercise those fixes. The tests introduced here will run automatically in CI and help ensure that the problem does not reoccur. Signed-off-by: Russell Bryant <rbryant@redhat.com>
111711f to
0de3f62
Compare
Contributor
Author
jwm4
pushed a commit
to jwm4/sdg
that referenced
this pull request
Dec 13, 2024
Create `docs/cli` directory
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.
97d3fcd filterblock: Don't break when filtering on unexpected data
111711f Add unit tests for sdg.filterblock
commit 97d3fcd
Author: Russell Bryant rbryant@redhat.com
Date: Wed Jul 3 19:53:23 2024 -0400
commit 111711fa419b53e2f31b63bcb91f829eacd55548
Author: Russell Bryant rbryant@redhat.com
Date: Wed Jul 3 19:56:45 2024 -0400