Skip to content

Commit

Permalink
chore: Add comment about zero value validation
Browse files Browse the repository at this point in the history
Signed-off-by: zlatan.el <[email protected]>
  • Loading branch information
km-zlatan-el committed Dec 19, 2022
1 parent 619f6c9 commit e0c952f
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sdk/python/feast/type_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ def _python_value_to_proto_value(
) = PYTHON_SCALAR_VALUE_TYPE_TO_PROTO_VALUE[feast_value_type]
if valid_scalar_types:
if sample == 0 or sample == 0.0:
# In the case of a value of 0, type validation cannot be performed with only one int or float type.
assert type(sample) in [np.int64, np.float64, float, int]
else:
assert type(sample) in valid_scalar_types
Expand Down

0 comments on commit e0c952f

Please sign in to comment.