You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
MatchingEngineIndexEndpoint.read_index_datapoints drops numeric_restricts for private endpoints #7272
google-cloud-aiplatform version: 1.130.0; the same code is on main at the time of writing
Summary
For an index deployed to a private (PSC / VPC) endpoint, MatchingEngineIndexEndpoint.read_index_datapoints() returns datapoints without numeric_restricts. Token restricts and crowding_tag are returned.
Steps to reproduce
Deploy an index to a private endpoint.
Upsert a datapoint that has a numeric restrict, e.g. NumericRestriction(namespace="expires_at", value_int=...).
Read it back with read_index_datapoints().
Code example
endpoint=aiplatform.MatchingEngineIndexEndpoint(index_endpoint_name=ENDPOINT)
endpoint.private_service_connect_ip_address=PSC_IP# private endpointdp=endpoint.read_index_datapoints(deployed_index_id=DEPLOYED_INDEX_ID, ids=[DATAPOINT_ID])[0]
print(dp.restricts) # token restricts are presentprint(dp.numeric_restricts) # empty, expected the numeric restrictemb=endpoint._batch_get_embeddings(deployed_index_id=DEPLOYED_INDEX_ID, ids=[DATAPOINT_ID])[0]
print(emb.numeric_restricts) # present: the server returns it
Cause
In the private-endpoint branch of read_index_datapoints (L1942-L1972), each Embedding from _batch_get_embeddings is converted to IndexDatapoint with feature_vector, restricts and crowding_tag only. Embedding.numeric_restricts (match_service.proto L138) is not copied.
MatchNeighbor.from_embedding already converts numeric_restricts for find_neighbors (L310), so this looks like an omission in the read path. The fix would map value_int / value_float / value_double to IndexDatapoint.NumericRestriction in the same way.
Activity
fix: Include numeric_restricts, sparse_embedding and embedding_metada…