Closed russellb closed 1 month ago
For reference, the type conversion failure handling case was introduced in #78
A tiny bit of searching led me to stuff like huggingface/datasets#3195 and huggingface/datasets#3676 - giving the impression that None is supposed to be handled, but it wouldn't surprise anyone if there were still latent bugs in None handling
From @russellb
Maybe we need a default value we set that's native to whatever we're trying to convert to. Otherwise right now we have a mix of things converted to a numeric type (in the case of the commit message) and None isn't valid for those.
Knowing what value we can use in this error case doesn't seem simple. It seems like it needs to be provided as configuration to the FilterBlock.
I did consider using a different default value than None - any value of that type that is not in filter_value would work, so we could randomly choose one? Ugh.
I also considered adding an "invalid_value" field, but adding something like that to the format to work around a bug? Ugh.
block_type: FilterByValueBlock
block_config:
block_name: filter_questions
filter_column: score
filter_value: 1.0
invalid_value: 0
operation: eq
convert_dtype: float
This change looks related: https://github.com/aakankshaduggal/sdg/pull/7/files
It's just dropping the samples converted to None
completely
This change looks related: https://github.com/aakankshaduggal/sdg/pull/7/files
It's just dropping the samples converted to
None
completely
From #110 I'm guessing it is to avoid:
TypeError: '>=' not supported between instances of 'NoneType' and 'float'
i.e. what we default to on error needs to be a valid value for any of the supported operators
I did consider using a different default value than None - any value of that type that is not in filter_value would work, so we could randomly choose one? Ugh.
So, no ... it's any value of that type which will cause the operator to return False
Pretty sure this is resolved by https://github.com/instructlab/sdg/pull/143
This issue is called out in one of the commits in PR #117
The related code in filterblock.py as of that PR is:
We need to investigate this error more deeply to figure out the best fix