Skip to content

Commit 1c7c491

Browse files
authored
fix: Add check for bool type in addition to sample (#3452)
fix: add check for bool type in addition to sample Signed-off-by: Ryan Beauchamp <[email protected]> Signed-off-by: Ryan Beauchamp <[email protected]>
1 parent 2f7c4ed commit 1c7c491

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sdk/python/feast/type_map.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ def _python_value_to_proto_value(
402402
valid_scalar_types,
403403
) = PYTHON_SCALAR_VALUE_TYPE_TO_PROTO_VALUE[feast_value_type]
404404
if valid_scalar_types:
405-
if sample == 0 or sample == 0.0:
405+
if (sample == 0 or sample == 0.0) and feast_value_type != ValueType.BOOL:
406406
# Numpy convert 0 to int. However, in the feature view definition, the type of column may be a float.
407407
# So, if value is 0, type validation must pass if scalar_types are either int or float.
408408
assert type(sample) in [np.int64, int, np.float64, float]

0 commit comments

Comments
 (0)