Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions chromadb/proto/convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,14 @@ def to_proto_metadata_update_value(
# Be careful with the order here. Since bools are a subtype of int in python,
# isinstance(value, bool) and isinstance(value, int) both return true
# for a value of bool type.
if isinstance(value, bool):
t = type(value)
if t is bool:
return chroma_pb.UpdateMetadataValue(bool_value=value)
elif isinstance(value, str):
elif t is str:
return chroma_pb.UpdateMetadataValue(string_value=value)
elif isinstance(value, int):
elif t is int:
return chroma_pb.UpdateMetadataValue(int_value=value)
elif isinstance(value, float):
elif t is float:
return chroma_pb.UpdateMetadataValue(float_value=value)
# None is used to delete the metadata key.
elif value is None:
Expand Down