Skip to content

Commit

Permalink
Fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorge committed Mar 12, 2024
1 parent c5201b1 commit 2d23bf6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,24 +91,24 @@ def to_data_points(
raise ValueError("All metadata keys must be strings")

if isinstance(value, str):
restriction = meidx_types.IndexDataPoint.Restriction(
restriction = meidx_types.IndexDatapoint.Restriction(
namespace=namespace, allow_list=[value]
)
restricts.append(restriction)
elif isinstance(value, list) and all(
isinstance(item, str) for item in value
):
restriction = meidx_types.IndexDataPoint.Restriction(
restriction = meidx_types.IndexDatapoint.Restriction(
namespace=namespace, allow_list=value
)
restricts.append(restriction)
elif isinstance(value, (int, float)) and not isinstance(value, bool):
restriction = meidx_types.IndexDataPoint.NumericRestriction(
restriction = meidx_types.IndexDatapoint.NumericRestriction(
namespace=namespace, value_float=value
)
numeric_restricts.append(restriction)

data_point = meidx_types.IndexDataPoint(
data_point = meidx_types.IndexDatapoint(
datapoint_id=id_,
feature_vector=embedding,
restricts=restricts,
Expand Down

0 comments on commit 2d23bf6

Please sign in to comment.