Skip to content

Commit

Permalink
[CLN] remove dead code in metadata proto conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
HammadB committed Apr 30, 2024
1 parent 0a3af05 commit d82fbc8
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions chromadb/segment/impl/metadata/grpc_segment.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,23 +247,9 @@ def _where_to_proto(self, where: Optional[Where]) -> pb.Where:
f"Expected where operand value to be a string, int, or float, got {operand}"
)
else:
# Our key is a metadata field name and the value is meant
# to be compared for strict equality.
if type(operand) is str:
ssc = pb.SingleStringComparison()
ssc.value = operand
ssc.comparator = pb.GenericComparator.EQ
dc.single_string_operand.CopyFrom(ssc)
elif type(operand) is int:
sic = pb.SingleIntComparison()
sic.value = operand
sic.generic_comparator = pb.GenericComparator.EQ
dc.single_int_operand.CopyFrom(sic)
elif type(operand) is float:
sfc = pb.SingleDoubleComparison()
sfc.value = operand
sfc.generic_comparator = pb.GenericComparator.EQ
dc.single_double_operand.CopyFrom(sfc)
# This case should never happen, as we've already
# handled the case for direct comparisons.
pass

response.direct_comparison.CopyFrom(dc)
return response
Expand Down

0 comments on commit d82fbc8

Please sign in to comment.