@@ -1060,6 +1060,7 @@ def test_private_index_endpoint_match_queries(
1060
1060
per_crowding_attribute_num_neighbors = _TEST_PER_CROWDING_ATTRIBUTE_NUM_NEIGHBOURS ,
1061
1061
approx_num_neighbors = _TEST_APPROX_NUM_NEIGHBORS ,
1062
1062
fraction_leaf_nodes_to_search_override = _TEST_FRACTION_LEAF_NODES_TO_SEARCH_OVERRIDE ,
1063
+ return_full_datapoint = _TEST_RETURN_FULL_DATAPOINT ,
1063
1064
)
1064
1065
1065
1066
batch_request = match_service_pb2 .BatchMatchRequest (
@@ -1081,6 +1082,7 @@ def test_private_index_endpoint_match_queries(
1081
1082
per_crowding_attribute_num_neighbors = _TEST_PER_CROWDING_ATTRIBUTE_NUM_NEIGHBOURS ,
1082
1083
approx_num_neighbors = _TEST_APPROX_NUM_NEIGHBORS ,
1083
1084
fraction_leaf_nodes_to_search_override = _TEST_FRACTION_LEAF_NODES_TO_SEARCH_OVERRIDE ,
1085
+ embedding_enabled = _TEST_RETURN_FULL_DATAPOINT ,
1084
1086
)
1085
1087
for i in range (len (_TEST_QUERIES ))
1086
1088
],
@@ -1096,11 +1098,11 @@ def test_private_index_endpoint_find_neighbor_queries(
1096
1098
):
1097
1099
aiplatform .init (project = _TEST_PROJECT )
1098
1100
1099
- my_pubic_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1101
+ my_private_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1100
1102
index_endpoint_name = _TEST_INDEX_ENDPOINT_ID
1101
1103
)
1102
1104
1103
- my_pubic_index_endpoint .find_neighbors (
1105
+ my_private_index_endpoint .find_neighbors (
1104
1106
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1105
1107
queries = _TEST_QUERIES ,
1106
1108
num_neighbors = _TEST_NUM_NEIGHBOURS ,
@@ -1130,6 +1132,7 @@ def test_private_index_endpoint_find_neighbor_queries(
1130
1132
per_crowding_attribute_num_neighbors = _TEST_PER_CROWDING_ATTRIBUTE_NUM_NEIGHBOURS ,
1131
1133
approx_num_neighbors = _TEST_APPROX_NUM_NEIGHBORS ,
1132
1134
fraction_leaf_nodes_to_search_override = _TEST_FRACTION_LEAF_NODES_TO_SEARCH_OVERRIDE ,
1135
+ embedding_enabled = _TEST_RETURN_FULL_DATAPOINT ,
1133
1136
)
1134
1137
for test_query in _TEST_QUERIES
1135
1138
],
@@ -1187,16 +1190,16 @@ def test_index_private_service_connect_endpoint_match_queries(
1187
1190
index_endpoint_match_queries_mock .assert_called_with (batch_request )
1188
1191
1189
1192
@pytest .mark .usefixtures ("get_index_public_endpoint_mock" )
1190
- def test_index_public_endpoint_match_queries (
1193
+ def test_index_public_endpoint_find_neighbors_queries (
1191
1194
self , index_public_endpoint_match_queries_mock
1192
1195
):
1193
1196
aiplatform .init (project = _TEST_PROJECT )
1194
1197
1195
- my_pubic_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1198
+ my_public_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1196
1199
index_endpoint_name = _TEST_INDEX_ENDPOINT_ID
1197
1200
)
1198
1201
1199
- my_pubic_index_endpoint .find_neighbors (
1202
+ my_public_index_endpoint .find_neighbors (
1200
1203
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1201
1204
queries = _TEST_QUERIES ,
1202
1205
num_neighbors = _TEST_NUM_NEIGHBOURS ,
@@ -1208,7 +1211,7 @@ def test_index_public_endpoint_match_queries(
1208
1211
)
1209
1212
1210
1213
find_neighbors_request = gca_match_service_v1beta1 .FindNeighborsRequest (
1211
- index_endpoint = my_pubic_index_endpoint .resource_name ,
1214
+ index_endpoint = my_public_index_endpoint .resource_name ,
1212
1215
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1213
1216
queries = [
1214
1217
gca_match_service_v1beta1 .FindNeighborsRequest .Query (
@@ -1241,11 +1244,11 @@ def test_index_public_endpoint_match_queries_with_numeric_filtering(
1241
1244
):
1242
1245
aiplatform .init (project = _TEST_PROJECT )
1243
1246
1244
- my_pubic_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1247
+ my_public_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1245
1248
index_endpoint_name = _TEST_INDEX_ENDPOINT_ID
1246
1249
)
1247
1250
1248
- my_pubic_index_endpoint .find_neighbors (
1251
+ my_public_index_endpoint .find_neighbors (
1249
1252
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1250
1253
queries = _TEST_QUERIES ,
1251
1254
num_neighbors = _TEST_NUM_NEIGHBOURS ,
@@ -1258,7 +1261,7 @@ def test_index_public_endpoint_match_queries_with_numeric_filtering(
1258
1261
)
1259
1262
1260
1263
find_neighbors_request = gca_match_service_v1beta1 .FindNeighborsRequest (
1261
- index_endpoint = my_pubic_index_endpoint .resource_name ,
1264
+ index_endpoint = my_public_index_endpoint .resource_name ,
1262
1265
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1263
1266
queries = [
1264
1267
gca_match_service_v1beta1 .FindNeighborsRequest .Query (
@@ -1337,18 +1340,18 @@ def test_index_public_endpoint_read_index_datapoints(
1337
1340
):
1338
1341
aiplatform .init (project = _TEST_PROJECT )
1339
1342
1340
- my_pubic_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1343
+ my_public_index_endpoint = aiplatform .MatchingEngineIndexEndpoint (
1341
1344
index_endpoint_name = _TEST_INDEX_ENDPOINT_ID
1342
1345
)
1343
1346
1344
- my_pubic_index_endpoint .read_index_datapoints (
1347
+ my_public_index_endpoint .read_index_datapoints (
1345
1348
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1346
1349
ids = _TEST_IDS ,
1347
1350
)
1348
1351
1349
1352
read_index_datapoints_request = (
1350
1353
gca_match_service_v1beta1 .ReadIndexDatapointsRequest (
1351
- index_endpoint = my_pubic_index_endpoint .resource_name ,
1354
+ index_endpoint = my_public_index_endpoint .resource_name ,
1352
1355
deployed_index_id = _TEST_DEPLOYED_INDEX_ID ,
1353
1356
ids = _TEST_IDS ,
1354
1357
)
0 commit comments