Skip to content

Commit 91ed3a6

Browse files
gcf-owl-bot[bot]dizcologypartheanayaknishant
authored
chore(bazel): move rules_gapic up in WORKSPACE loading order (googleapis#1454)
* feat: add BatchImportModelEvaluationSlices API in aiplatform v1 model_service.proto PiperOrigin-RevId: 456604066 Source-Link: googleapis/googleapis@d57f437 Source-Link: https://github.com/googleapis/googleapis-gen/commit/d9f3b867c60688ee2ed5dbf572ad88913d1fce45 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDlmM2I4NjdjNjA2ODhlZTJlZDVkYmY1NzJhZDg4OTEzZDFmY2U0NSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add audience parameter PiperOrigin-RevId: 456827138 Source-Link: googleapis/googleapis@23f1a15 Source-Link: https://github.com/googleapis/googleapis-gen/commit/4075a8514f676691ec156688a5bbf183aa9893ce Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNDA3NWE4NTE0ZjY3NjY5MWVjMTU2Njg4YTViYmYxODNhYTk4OTNjZSJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * feat: add ListSavedQueries rpc to aiplatform v1beta1 dataset_service.proto feat: add saved_query.proto to aiplatform v1beta1 feat: add saved_query_id to InputDataConfig in aiplatform v1beta1 training_pipeline.proto PiperOrigin-RevId: 456872207 Source-Link: googleapis/googleapis@aeb384a Source-Link: https://github.com/googleapis/googleapis-gen/commit/c5c8894abbfcd1f6b9d38d9e9fd70a18f15cf0cc Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYzVjODg5NGFiYmZjZDFmNmI5ZDM4ZDllOWZkNzBhMThmMTVjZjBjYyJ9 * feat: add ListSavedQueries rpc to aiplatform v1 dataset_service.proto feat: add saved_query.proto to aiplatform v1 feat: add saved_query_id to InputDataConfig in aiplatform v1 training_pipeline.proto PiperOrigin-RevId: 456872211 Source-Link: googleapis/googleapis@88f3973 Source-Link: https://github.com/googleapis/googleapis-gen/commit/daf8d1cb20fadabdd8914581da1ceeef048a34f7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGFmOGQxY2IyMGZhZGFiZGQ4OTE0NTgxZGExY2VlZWYwNDhhMzRmNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * docs: clarify descriptions of the AdvancedSettings and WebhookRequest data types PiperOrigin-RevId: 458000126 Source-Link: googleapis/googleapis@c425ac6 Source-Link: https://github.com/googleapis/googleapis-gen/commit/1b0446dbaba086f1bf64d976b180d6ab6f338eb6 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMWIwNDQ2ZGJhYmEwODZmMWJmNjRkOTc2YjE4MGQ2YWI2ZjMzOGViNiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: Upgrade `rules_python` to 0.9.0 fix: Set bazel python interpreter to 3.9 PiperOrigin-RevId: 459075062 Source-Link: googleapis/googleapis@99fa3a5 Source-Link: https://github.com/googleapis/googleapis-gen/commit/857bba1ea3efd9b03bd7d14b81b9f78db01d401d Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiODU3YmJhMWVhM2VmZDliMDNiZDdkMTRiODFiOWY3OGRiMDFkNDAxZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore: use gapic-generator-python 1.1.1 PiperOrigin-RevId: 459095142 Source-Link: googleapis/googleapis@4f1be99 Source-Link: https://github.com/googleapis/googleapis-gen/commit/ae686d9cde4fc3e36d0ac02efb8643b15890c1ed Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWU2ODZkOWNkZTRmYzNlMzZkMGFjMDJlZmI4NjQzYjE1ODkwYzFlZCJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix(deps): require google-api-core 2.8.0 * chore: remove unused imports PiperOrigin-RevId: 459515628 Source-Link: googleapis/googleapis@ed9ca3b Source-Link: https://github.com/googleapis/googleapis-gen/commit/94137b9ca03191691de40fc05eef6f695e490b76 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiOTQxMzdiOWNhMDMxOTE2OTFkZTQwZmMwNWVlZjZmNjk1ZTQ5MGI3NiJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * fix: update rules_go, grpc, gazelle and python toolchain to latest versions to fix various build issues PiperOrigin-RevId: 459858846 Source-Link: googleapis/googleapis@21ef848 Source-Link: https://github.com/googleapis/googleapis-gen/commit/26af3a384be4077c5f0100521a263fd9bd8fc7e7 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMjZhZjNhMzg0YmU0MDc3YzVmMDEwMDUyMWEyNjNmZDliZDhmYzdlNyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * chore(bazel): move rules_gapic up in WORKSPACE loading order PiperOrigin-RevId: 460327690 Source-Link: googleapis/googleapis@f86f3a2 Source-Link: https://github.com/googleapis/googleapis-gen/commit/76d224d57ac2c3cb0f21301703b4bcb99c7bd043 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNzZkMjI0ZDU3YWMyYzNjYjBmMjEzMDE3MDNiNGJjYjk5YzdiZDA0MyJ9 * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com> Co-authored-by: Yu-Han Liu <[email protected]> Co-authored-by: Anthonios Partheniou <[email protected]> Co-authored-by: nayaknishant <[email protected]>
1 parent 1b16f90 commit 91ed3a6

181 files changed

Lines changed: 5872 additions & 229 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

google/cloud/aiplatform_v1/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@
8787
from .types.dataset_service import ListDataItemsResponse
8888
from .types.dataset_service import ListDatasetsRequest
8989
from .types.dataset_service import ListDatasetsResponse
90+
from .types.dataset_service import ListSavedQueriesRequest
91+
from .types.dataset_service import ListSavedQueriesResponse
9092
from .types.dataset_service import UpdateDatasetRequest
9193
from .types.deployed_index_ref import DeployedIndexRef
9294
from .types.deployed_model_ref import DeployedModelRef
@@ -345,6 +347,8 @@
345347
from .types.model_monitoring import ModelMonitoringObjectiveConfig
346348
from .types.model_monitoring import SamplingStrategy
347349
from .types.model_monitoring import ThresholdConfig
350+
from .types.model_service import BatchImportModelEvaluationSlicesRequest
351+
from .types.model_service import BatchImportModelEvaluationSlicesResponse
348352
from .types.model_service import DeleteModelRequest
349353
from .types.model_service import DeleteModelVersionRequest
350354
from .types.model_service import ExportModelOperationMetadata
@@ -393,6 +397,7 @@
393397
from .types.prediction_service import PredictRequest
394398
from .types.prediction_service import PredictResponse
395399
from .types.prediction_service import RawPredictRequest
400+
from .types.saved_query import SavedQuery
396401
from .types.specialist_pool import SpecialistPool
397402
from .types.specialist_pool_service import CreateSpecialistPoolOperationMetadata
398403
from .types.specialist_pool_service import CreateSpecialistPoolRequest
@@ -535,6 +540,8 @@
535540
"BatchCreateTensorboardTimeSeriesRequest",
536541
"BatchCreateTensorboardTimeSeriesResponse",
537542
"BatchDedicatedResources",
543+
"BatchImportModelEvaluationSlicesRequest",
544+
"BatchImportModelEvaluationSlicesResponse",
538545
"BatchMigrateResourcesOperationMetadata",
539546
"BatchMigrateResourcesRequest",
540547
"BatchMigrateResourcesResponse",
@@ -796,6 +803,8 @@
796803
"ListOptimalTrialsResponse",
797804
"ListPipelineJobsRequest",
798805
"ListPipelineJobsResponse",
806+
"ListSavedQueriesRequest",
807+
"ListSavedQueriesResponse",
799808
"ListSpecialistPoolsRequest",
800809
"ListSpecialistPoolsResponse",
801810
"ListStudiesRequest",
@@ -886,6 +895,7 @@
886895
"SampleConfig",
887896
"SampledShapleyAttribution",
888897
"SamplingStrategy",
898+
"SavedQuery",
889899
"Scalar",
890900
"Scheduling",
891901
"SearchFeaturesRequest",

google/cloud/aiplatform_v1/gapic_metadata.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@
5555
"list_datasets"
5656
]
5757
},
58+
"ListSavedQueries": {
59+
"methods": [
60+
"list_saved_queries"
61+
]
62+
},
5863
"UpdateDataset": {
5964
"methods": [
6065
"update_dataset"
@@ -110,6 +115,11 @@
110115
"list_datasets"
111116
]
112117
},
118+
"ListSavedQueries": {
119+
"methods": [
120+
"list_saved_queries"
121+
]
122+
},
113123
"UpdateDataset": {
114124
"methods": [
115125
"update_dataset"
@@ -1266,6 +1276,11 @@
12661276
"grpc": {
12671277
"libraryClient": "ModelServiceClient",
12681278
"rpcs": {
1279+
"BatchImportModelEvaluationSlices": {
1280+
"methods": [
1281+
"batch_import_model_evaluation_slices"
1282+
]
1283+
},
12691284
"DeleteModel": {
12701285
"methods": [
12711286
"delete_model"
@@ -1341,6 +1356,11 @@
13411356
"grpc-async": {
13421357
"libraryClient": "ModelServiceAsyncClient",
13431358
"rpcs": {
1359+
"BatchImportModelEvaluationSlices": {
1360+
"methods": [
1361+
"batch_import_model_evaluation_slices"
1362+
]
1363+
},
13441364
"DeleteModel": {
13451365
"methods": [
13461366
"delete_model"

google/cloud/aiplatform_v1/services/dataset_service/async_client.py

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@
4242
from google.cloud.aiplatform_v1.types import dataset_service
4343
from google.cloud.aiplatform_v1.types import encryption_spec
4444
from google.cloud.aiplatform_v1.types import operation as gca_operation
45+
from google.cloud.aiplatform_v1.types import saved_query
4546
from google.cloud.location import locations_pb2 # type: ignore
4647
from google.iam.v1 import iam_policy_pb2 # type: ignore
4748
from google.iam.v1 import policy_pb2 # type: ignore
@@ -75,6 +76,8 @@ class DatasetServiceAsyncClient:
7576
parse_data_item_path = staticmethod(DatasetServiceClient.parse_data_item_path)
7677
dataset_path = staticmethod(DatasetServiceClient.dataset_path)
7778
parse_dataset_path = staticmethod(DatasetServiceClient.parse_dataset_path)
79+
saved_query_path = staticmethod(DatasetServiceClient.saved_query_path)
80+
parse_saved_query_path = staticmethod(DatasetServiceClient.parse_saved_query_path)
7881
common_billing_account_path = staticmethod(
7982
DatasetServiceClient.common_billing_account_path
8083
)
@@ -1157,6 +1160,115 @@ async def sample_list_data_items():
11571160
# Done; return the response.
11581161
return response
11591162

1163+
async def list_saved_queries(
1164+
self,
1165+
request: Union[dataset_service.ListSavedQueriesRequest, dict] = None,
1166+
*,
1167+
parent: str = None,
1168+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1169+
timeout: float = None,
1170+
metadata: Sequence[Tuple[str, str]] = (),
1171+
) -> pagers.ListSavedQueriesAsyncPager:
1172+
r"""Lists SavedQueries in a Dataset.
1173+
1174+
.. code-block:: python
1175+
1176+
from google.cloud import aiplatform_v1
1177+
1178+
async def sample_list_saved_queries():
1179+
# Create a client
1180+
client = aiplatform_v1.DatasetServiceAsyncClient()
1181+
1182+
# Initialize request argument(s)
1183+
request = aiplatform_v1.ListSavedQueriesRequest(
1184+
parent="parent_value",
1185+
)
1186+
1187+
# Make the request
1188+
page_result = client.list_saved_queries(request=request)
1189+
1190+
# Handle the response
1191+
async for response in page_result:
1192+
print(response)
1193+
1194+
Args:
1195+
request (Union[google.cloud.aiplatform_v1.types.ListSavedQueriesRequest, dict]):
1196+
The request object. Request message for
1197+
[DatasetService.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries].
1198+
parent (:class:`str`):
1199+
Required. The resource name of the Dataset to list
1200+
SavedQueries from. Format:
1201+
``projects/{project}/locations/{location}/datasets/{dataset}``
1202+
1203+
This corresponds to the ``parent`` field
1204+
on the ``request`` instance; if ``request`` is provided, this
1205+
should not be set.
1206+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1207+
should be retried.
1208+
timeout (float): The timeout for this request.
1209+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1210+
sent along with the request as metadata.
1211+
1212+
Returns:
1213+
google.cloud.aiplatform_v1.services.dataset_service.pagers.ListSavedQueriesAsyncPager:
1214+
Response message for
1215+
[DatasetService.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries].
1216+
1217+
Iterating over this object will yield results and
1218+
resolve additional pages automatically.
1219+
1220+
"""
1221+
# Create or coerce a protobuf request object.
1222+
# Quick check: If we got a request object, we should *not* have
1223+
# gotten any keyword arguments that map to the request.
1224+
has_flattened_params = any([parent])
1225+
if request is not None and has_flattened_params:
1226+
raise ValueError(
1227+
"If the `request` argument is set, then none of "
1228+
"the individual field arguments should be set."
1229+
)
1230+
1231+
request = dataset_service.ListSavedQueriesRequest(request)
1232+
1233+
# If we have keyword arguments corresponding to fields on the
1234+
# request, apply these.
1235+
if parent is not None:
1236+
request.parent = parent
1237+
1238+
# Wrap the RPC method; this adds retry and timeout information,
1239+
# and friendly error handling.
1240+
rpc = gapic_v1.method_async.wrap_method(
1241+
self._client._transport.list_saved_queries,
1242+
default_timeout=None,
1243+
client_info=DEFAULT_CLIENT_INFO,
1244+
)
1245+
1246+
# Certain fields should be provided within the metadata header;
1247+
# add these here.
1248+
metadata = tuple(metadata) + (
1249+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1250+
)
1251+
1252+
# Send the request.
1253+
response = await rpc(
1254+
request,
1255+
retry=retry,
1256+
timeout=timeout,
1257+
metadata=metadata,
1258+
)
1259+
1260+
# This method is paged; wrap the response in a pager, which provides
1261+
# an `__aiter__` convenience method.
1262+
response = pagers.ListSavedQueriesAsyncPager(
1263+
method=rpc,
1264+
request=request,
1265+
response=response,
1266+
metadata=metadata,
1267+
)
1268+
1269+
# Done; return the response.
1270+
return response
1271+
11601272
async def get_annotation_spec(
11611273
self,
11621274
request: Union[dataset_service.GetAnnotationSpecRequest, dict] = None,

google/cloud/aiplatform_v1/services/dataset_service/client.py

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
from google.cloud.aiplatform_v1.types import dataset_service
4646
from google.cloud.aiplatform_v1.types import encryption_spec
4747
from google.cloud.aiplatform_v1.types import operation as gca_operation
48+
from google.cloud.aiplatform_v1.types import saved_query
4849
from google.cloud.location import locations_pb2 # type: ignore
4950
from google.iam.v1 import iam_policy_pb2 # type: ignore
5051
from google.iam.v1 import policy_pb2 # type: ignore
@@ -277,6 +278,30 @@ def parse_dataset_path(path: str) -> Dict[str, str]:
277278
)
278279
return m.groupdict() if m else {}
279280

281+
@staticmethod
282+
def saved_query_path(
283+
project: str,
284+
location: str,
285+
dataset: str,
286+
saved_query: str,
287+
) -> str:
288+
"""Returns a fully-qualified saved_query string."""
289+
return "projects/{project}/locations/{location}/datasets/{dataset}/savedQueries/{saved_query}".format(
290+
project=project,
291+
location=location,
292+
dataset=dataset,
293+
saved_query=saved_query,
294+
)
295+
296+
@staticmethod
297+
def parse_saved_query_path(path: str) -> Dict[str, str]:
298+
"""Parses a saved_query path into its component segments."""
299+
m = re.match(
300+
r"^projects/(?P<project>.+?)/locations/(?P<location>.+?)/datasets/(?P<dataset>.+?)/savedQueries/(?P<saved_query>.+?)$",
301+
path,
302+
)
303+
return m.groupdict() if m else {}
304+
280305
@staticmethod
281306
def common_billing_account_path(
282307
billing_account: str,
@@ -517,6 +542,7 @@ def __init__(
517542
quota_project_id=client_options.quota_project_id,
518543
client_info=client_info,
519544
always_use_jwt_access=True,
545+
api_audience=client_options.api_audience,
520546
)
521547

522548
def create_dataset(
@@ -1447,6 +1473,115 @@ def sample_list_data_items():
14471473
# Done; return the response.
14481474
return response
14491475

1476+
def list_saved_queries(
1477+
self,
1478+
request: Union[dataset_service.ListSavedQueriesRequest, dict] = None,
1479+
*,
1480+
parent: str = None,
1481+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1482+
timeout: float = None,
1483+
metadata: Sequence[Tuple[str, str]] = (),
1484+
) -> pagers.ListSavedQueriesPager:
1485+
r"""Lists SavedQueries in a Dataset.
1486+
1487+
.. code-block:: python
1488+
1489+
from google.cloud import aiplatform_v1
1490+
1491+
def sample_list_saved_queries():
1492+
# Create a client
1493+
client = aiplatform_v1.DatasetServiceClient()
1494+
1495+
# Initialize request argument(s)
1496+
request = aiplatform_v1.ListSavedQueriesRequest(
1497+
parent="parent_value",
1498+
)
1499+
1500+
# Make the request
1501+
page_result = client.list_saved_queries(request=request)
1502+
1503+
# Handle the response
1504+
for response in page_result:
1505+
print(response)
1506+
1507+
Args:
1508+
request (Union[google.cloud.aiplatform_v1.types.ListSavedQueriesRequest, dict]):
1509+
The request object. Request message for
1510+
[DatasetService.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries].
1511+
parent (str):
1512+
Required. The resource name of the Dataset to list
1513+
SavedQueries from. Format:
1514+
``projects/{project}/locations/{location}/datasets/{dataset}``
1515+
1516+
This corresponds to the ``parent`` field
1517+
on the ``request`` instance; if ``request`` is provided, this
1518+
should not be set.
1519+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1520+
should be retried.
1521+
timeout (float): The timeout for this request.
1522+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1523+
sent along with the request as metadata.
1524+
1525+
Returns:
1526+
google.cloud.aiplatform_v1.services.dataset_service.pagers.ListSavedQueriesPager:
1527+
Response message for
1528+
[DatasetService.ListSavedQueries][google.cloud.aiplatform.v1.DatasetService.ListSavedQueries].
1529+
1530+
Iterating over this object will yield results and
1531+
resolve additional pages automatically.
1532+
1533+
"""
1534+
# Create or coerce a protobuf request object.
1535+
# Quick check: If we got a request object, we should *not* have
1536+
# gotten any keyword arguments that map to the request.
1537+
has_flattened_params = any([parent])
1538+
if request is not None and has_flattened_params:
1539+
raise ValueError(
1540+
"If the `request` argument is set, then none of "
1541+
"the individual field arguments should be set."
1542+
)
1543+
1544+
# Minor optimization to avoid making a copy if the user passes
1545+
# in a dataset_service.ListSavedQueriesRequest.
1546+
# There's no risk of modifying the input as we've already verified
1547+
# there are no flattened fields.
1548+
if not isinstance(request, dataset_service.ListSavedQueriesRequest):
1549+
request = dataset_service.ListSavedQueriesRequest(request)
1550+
# If we have keyword arguments corresponding to fields on the
1551+
# request, apply these.
1552+
if parent is not None:
1553+
request.parent = parent
1554+
1555+
# Wrap the RPC method; this adds retry and timeout information,
1556+
# and friendly error handling.
1557+
rpc = self._transport._wrapped_methods[self._transport.list_saved_queries]
1558+
1559+
# Certain fields should be provided within the metadata header;
1560+
# add these here.
1561+
metadata = tuple(metadata) + (
1562+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1563+
)
1564+
1565+
# Send the request.
1566+
response = rpc(
1567+
request,
1568+
retry=retry,
1569+
timeout=timeout,
1570+
metadata=metadata,
1571+
)
1572+
1573+
# This method is paged; wrap the response in a pager, which provides
1574+
# an `__iter__` convenience method.
1575+
response = pagers.ListSavedQueriesPager(
1576+
method=rpc,
1577+
request=request,
1578+
response=response,
1579+
metadata=metadata,
1580+
)
1581+
1582+
# Done; return the response.
1583+
return response
1584+
14501585
def get_annotation_spec(
14511586
self,
14521587
request: Union[dataset_service.GetAnnotationSpecRequest, dict] = None,

0 commit comments

Comments
 (0)