Skip to content

MatchingEngineIndexEndpoint.read_index_datapoints drops numeric_restricts for private endpoints #7272

Open

Description

@t-ngtn

Environment details

  • OS type and version: Linux
  • Python version: 3.12
  • 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

  1. Deploy an index to a private endpoint.
  2. Upsert a datapoint that has a numeric restrict, e.g. NumericRestriction(namespace="expires_at", value_int=...).
  3. 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 endpoint

dp = endpoint.read_index_datapoints(deployed_index_id=DEPLOYED_INDEX_ID, ids=[DATAPOINT_ID])[0]
print(dp.restricts)          # token restricts are present
print(dp.numeric_restricts)  # empty, expected the numeric restrict

emb = 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.

I'm happy to send a PR for this.

Activity

  1. added a commit that references this issue on Nov 6, 2026
    41a1427
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions