Skip to content

Commit acf3113

Browse files
gcf-owl-bot[bot]copybara-github
authored andcommitted
Copybara import of the project:
-- 172112f by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: feat: Add field `protobuf_pythonic_types_enabled` to message `ExperimentalFeatures` docs: A comment for field `unit` in message `.google.api.QuotaLimit` is changed PiperOrigin-RevId: 693815606 Source-Link: googleapis/googleapis@69c246d Source-Link: googleapis/googleapis-gen@af34097 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiYWYzNDA5N2MxNTlmM2ZmMDk4NTYyN2M3YzA2YTU3NTk2ZDAwZDg3NyJ9 chore: remove body selector from http rule PiperOrigin-RevId: 693215877 Source-Link: googleapis/googleapis@bb6b53e Source-Link: googleapis/googleapis-gen@db8b5a9 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZGI4YjVhOTM0ODRhZDQ0MDU1YjJiYWNjNGM3Y2Y4N2U5NzBmZTBlZCJ9 feat: Add Feature Monitoring API to Feature Store docs: update feature creation message commentary PiperOrigin-RevId: 692336095 Source-Link: googleapis/googleapis@9b94dba Source-Link: googleapis/googleapis-gen@cd2ad6c Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiY2QyYWQ2Y2NjNzIyOWJkOTM3MzFmMTQwYWNiMWJlZDJhNGMwNDRkYyJ9 feat: add BatchCreateFeatures rpc to feature_registry_service.proto docs: A comment for field `feature_group_id` in message `.google.cloud.aiplatform.v1.CreateFeatureGroupRequest` is changed docs: A comment for message `BatchCreateFeaturesRequest` is modified to call out BatchCreateFeatures PiperOrigin-RevId: 692286681 Source-Link: googleapis/googleapis@3216422 Source-Link: googleapis/googleapis-gen@33795ce Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiMzM3OTVjZTFkNjYyM2UxMTE5MWIyYTM5NGE4OTU1NGVjOWY2NmFhOCJ9 feat: add system labels field to model garden deployments PiperOrigin-RevId: 692254608 Source-Link: googleapis/googleapis@cac70e2 Source-Link: googleapis/googleapis-gen@4e5dda3 Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiNGU1ZGRhM2I3YzYzNTkxMjIyMWIyMDRhMDhhMjYxZDc0NGE1ODJlZSJ9 -- 6ba85af by Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>: 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md COPYBARA_INTEGRATE_REVIEW=#4612 from googleapis:owl-bot-copy 6ba85af PiperOrigin-RevId: 693989346
1 parent 36755e3 commit acf3113

File tree

138 files changed

+26630
-9237
lines changed

Some content is hidden

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

138 files changed

+26630
-9237
lines changed

google/cloud/aiplatform_v1/gapic_metadata.json

+15
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,11 @@
859859
"grpc": {
860860
"libraryClient": "FeatureRegistryServiceClient",
861861
"rpcs": {
862+
"BatchCreateFeatures": {
863+
"methods": [
864+
"batch_create_features"
865+
]
866+
},
862867
"CreateFeature": {
863868
"methods": [
864869
"create_feature"
@@ -914,6 +919,11 @@
914919
"grpc-async": {
915920
"libraryClient": "FeatureRegistryServiceAsyncClient",
916921
"rpcs": {
922+
"BatchCreateFeatures": {
923+
"methods": [
924+
"batch_create_features"
925+
]
926+
},
917927
"CreateFeature": {
918928
"methods": [
919929
"create_feature"
@@ -969,6 +979,11 @@
969979
"rest": {
970980
"libraryClient": "FeatureRegistryServiceClient",
971981
"rpcs": {
982+
"BatchCreateFeatures": {
983+
"methods": [
984+
"batch_create_features"
985+
]
986+
},
972987
"CreateFeature": {
973988
"methods": [
974989
"create_feature"

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

+149-1
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ async def sample_create_feature_group():
354354
will become the final component of the FeatureGroup's
355355
resource name.
356356
357-
This value may be up to 60 characters, and valid
357+
This value may be up to 128 characters, and valid
358358
characters are ``[a-z0-9_]``. The first character cannot
359359
be a number.
360360
@@ -1118,6 +1118,154 @@ async def sample_create_feature():
11181118
# Done; return the response.
11191119
return response
11201120

1121+
async def batch_create_features(
1122+
self,
1123+
request: Optional[
1124+
Union[featurestore_service.BatchCreateFeaturesRequest, dict]
1125+
] = None,
1126+
*,
1127+
parent: Optional[str] = None,
1128+
requests: Optional[
1129+
MutableSequence[featurestore_service.CreateFeatureRequest]
1130+
] = None,
1131+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1132+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1133+
metadata: Sequence[Tuple[str, str]] = (),
1134+
) -> operation_async.AsyncOperation:
1135+
r"""Creates a batch of Features in a given FeatureGroup.
1136+
1137+
.. code-block:: python
1138+
1139+
# This snippet has been automatically generated and should be regarded as a
1140+
# code template only.
1141+
# It will require modifications to work:
1142+
# - It may require correct/in-range values for request initialization.
1143+
# - It may require specifying regional endpoints when creating the service
1144+
# client as shown in:
1145+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1146+
from google.cloud import aiplatform_v1
1147+
1148+
async def sample_batch_create_features():
1149+
# Create a client
1150+
client = aiplatform_v1.FeatureRegistryServiceAsyncClient()
1151+
1152+
# Initialize request argument(s)
1153+
requests = aiplatform_v1.CreateFeatureRequest()
1154+
requests.parent = "parent_value"
1155+
requests.feature_id = "feature_id_value"
1156+
1157+
request = aiplatform_v1.BatchCreateFeaturesRequest(
1158+
parent="parent_value",
1159+
requests=requests,
1160+
)
1161+
1162+
# Make the request
1163+
operation = client.batch_create_features(request=request)
1164+
1165+
print("Waiting for operation to complete...")
1166+
1167+
response = (await operation).result()
1168+
1169+
# Handle the response
1170+
print(response)
1171+
1172+
Args:
1173+
request (Optional[Union[google.cloud.aiplatform_v1.types.BatchCreateFeaturesRequest, dict]]):
1174+
The request object. Request message for
1175+
[FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures].
1176+
Request message for
1177+
[FeatureRegistryService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeatureRegistryService.BatchCreateFeatures].
1178+
parent (:class:`str`):
1179+
Required. The resource name of the
1180+
EntityType/FeatureGroup to create the batch of Features
1181+
under. Format:
1182+
``projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}``
1183+
``projects/{project}/locations/{location}/featureGroups/{feature_group}``
1184+
1185+
This corresponds to the ``parent`` field
1186+
on the ``request`` instance; if ``request`` is provided, this
1187+
should not be set.
1188+
requests (:class:`MutableSequence[google.cloud.aiplatform_v1.types.CreateFeatureRequest]`):
1189+
Required. The request message specifying the Features to
1190+
create. All Features must be created under the same
1191+
parent EntityType / FeatureGroup. The ``parent`` field
1192+
in each child request message can be omitted. If
1193+
``parent`` is set in a child request, then the value
1194+
must match the ``parent`` value in this request message.
1195+
1196+
This corresponds to the ``requests`` field
1197+
on the ``request`` instance; if ``request`` is provided, this
1198+
should not be set.
1199+
retry (google.api_core.retry_async.AsyncRetry): Designation of what errors, if any,
1200+
should be retried.
1201+
timeout (float): The timeout for this request.
1202+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1203+
sent along with the request as metadata.
1204+
1205+
Returns:
1206+
google.api_core.operation_async.AsyncOperation:
1207+
An object representing a long-running operation.
1208+
1209+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.BatchCreateFeaturesResponse` Response message for
1210+
[FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures].
1211+
1212+
"""
1213+
# Create or coerce a protobuf request object.
1214+
# - Quick check: If we got a request object, we should *not* have
1215+
# gotten any keyword arguments that map to the request.
1216+
has_flattened_params = any([parent, requests])
1217+
if request is not None and has_flattened_params:
1218+
raise ValueError(
1219+
"If the `request` argument is set, then none of "
1220+
"the individual field arguments should be set."
1221+
)
1222+
1223+
# - Use the request object if provided (there's no risk of modifying the input as
1224+
# there are no flattened fields), or create one.
1225+
if not isinstance(request, featurestore_service.BatchCreateFeaturesRequest):
1226+
request = featurestore_service.BatchCreateFeaturesRequest(request)
1227+
1228+
# If we have keyword arguments corresponding to fields on the
1229+
# request, apply these.
1230+
if parent is not None:
1231+
request.parent = parent
1232+
if requests:
1233+
request.requests.extend(requests)
1234+
1235+
# Wrap the RPC method; this adds retry and timeout information,
1236+
# and friendly error handling.
1237+
rpc = self._client._transport._wrapped_methods[
1238+
self._client._transport.batch_create_features
1239+
]
1240+
1241+
# Certain fields should be provided within the metadata header;
1242+
# add these here.
1243+
metadata = tuple(metadata) + (
1244+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1245+
)
1246+
1247+
# Validate the universe domain.
1248+
self._client._validate_universe_domain()
1249+
1250+
# Send the request.
1251+
response = await rpc(
1252+
request,
1253+
retry=retry,
1254+
timeout=timeout,
1255+
metadata=metadata,
1256+
)
1257+
1258+
# Wrap the response in an operation future.
1259+
response = operation_async.from_gapic(
1260+
response,
1261+
self._client._transport.operations_client,
1262+
featurestore_service.BatchCreateFeaturesResponse,
1263+
metadata_type=featurestore_service.BatchCreateFeaturesOperationMetadata,
1264+
)
1265+
1266+
# Done; return the response.
1267+
return response
1268+
11211269
async def get_feature(
11221270
self,
11231271
request: Optional[Union[featurestore_service.GetFeatureRequest, dict]] = None,

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

+146-1
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,7 @@ def sample_create_feature_group():
804804
will become the final component of the FeatureGroup's
805805
resource name.
806806
807-
This value may be up to 60 characters, and valid
807+
This value may be up to 128 characters, and valid
808808
characters are ``[a-z0-9_]``. The first character cannot
809809
be a number.
810810
@@ -1550,6 +1550,151 @@ def sample_create_feature():
15501550
# Done; return the response.
15511551
return response
15521552

1553+
def batch_create_features(
1554+
self,
1555+
request: Optional[
1556+
Union[featurestore_service.BatchCreateFeaturesRequest, dict]
1557+
] = None,
1558+
*,
1559+
parent: Optional[str] = None,
1560+
requests: Optional[
1561+
MutableSequence[featurestore_service.CreateFeatureRequest]
1562+
] = None,
1563+
retry: OptionalRetry = gapic_v1.method.DEFAULT,
1564+
timeout: Union[float, object] = gapic_v1.method.DEFAULT,
1565+
metadata: Sequence[Tuple[str, str]] = (),
1566+
) -> gac_operation.Operation:
1567+
r"""Creates a batch of Features in a given FeatureGroup.
1568+
1569+
.. code-block:: python
1570+
1571+
# This snippet has been automatically generated and should be regarded as a
1572+
# code template only.
1573+
# It will require modifications to work:
1574+
# - It may require correct/in-range values for request initialization.
1575+
# - It may require specifying regional endpoints when creating the service
1576+
# client as shown in:
1577+
# https://googleapis.dev/python/google-api-core/latest/client_options.html
1578+
from google.cloud import aiplatform_v1
1579+
1580+
def sample_batch_create_features():
1581+
# Create a client
1582+
client = aiplatform_v1.FeatureRegistryServiceClient()
1583+
1584+
# Initialize request argument(s)
1585+
requests = aiplatform_v1.CreateFeatureRequest()
1586+
requests.parent = "parent_value"
1587+
requests.feature_id = "feature_id_value"
1588+
1589+
request = aiplatform_v1.BatchCreateFeaturesRequest(
1590+
parent="parent_value",
1591+
requests=requests,
1592+
)
1593+
1594+
# Make the request
1595+
operation = client.batch_create_features(request=request)
1596+
1597+
print("Waiting for operation to complete...")
1598+
1599+
response = operation.result()
1600+
1601+
# Handle the response
1602+
print(response)
1603+
1604+
Args:
1605+
request (Union[google.cloud.aiplatform_v1.types.BatchCreateFeaturesRequest, dict]):
1606+
The request object. Request message for
1607+
[FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures].
1608+
Request message for
1609+
[FeatureRegistryService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeatureRegistryService.BatchCreateFeatures].
1610+
parent (str):
1611+
Required. The resource name of the
1612+
EntityType/FeatureGroup to create the batch of Features
1613+
under. Format:
1614+
``projects/{project}/locations/{location}/featurestores/{featurestore}/entityTypes/{entity_type}``
1615+
``projects/{project}/locations/{location}/featureGroups/{feature_group}``
1616+
1617+
This corresponds to the ``parent`` field
1618+
on the ``request`` instance; if ``request`` is provided, this
1619+
should not be set.
1620+
requests (MutableSequence[google.cloud.aiplatform_v1.types.CreateFeatureRequest]):
1621+
Required. The request message specifying the Features to
1622+
create. All Features must be created under the same
1623+
parent EntityType / FeatureGroup. The ``parent`` field
1624+
in each child request message can be omitted. If
1625+
``parent`` is set in a child request, then the value
1626+
must match the ``parent`` value in this request message.
1627+
1628+
This corresponds to the ``requests`` field
1629+
on the ``request`` instance; if ``request`` is provided, this
1630+
should not be set.
1631+
retry (google.api_core.retry.Retry): Designation of what errors, if any,
1632+
should be retried.
1633+
timeout (float): The timeout for this request.
1634+
metadata (Sequence[Tuple[str, str]]): Strings which should be
1635+
sent along with the request as metadata.
1636+
1637+
Returns:
1638+
google.api_core.operation.Operation:
1639+
An object representing a long-running operation.
1640+
1641+
The result type for the operation will be :class:`google.cloud.aiplatform_v1.types.BatchCreateFeaturesResponse` Response message for
1642+
[FeaturestoreService.BatchCreateFeatures][google.cloud.aiplatform.v1.FeaturestoreService.BatchCreateFeatures].
1643+
1644+
"""
1645+
# Create or coerce a protobuf request object.
1646+
# - Quick check: If we got a request object, we should *not* have
1647+
# gotten any keyword arguments that map to the request.
1648+
has_flattened_params = any([parent, requests])
1649+
if request is not None and has_flattened_params:
1650+
raise ValueError(
1651+
"If the `request` argument is set, then none of "
1652+
"the individual field arguments should be set."
1653+
)
1654+
1655+
# - Use the request object if provided (there's no risk of modifying the input as
1656+
# there are no flattened fields), or create one.
1657+
if not isinstance(request, featurestore_service.BatchCreateFeaturesRequest):
1658+
request = featurestore_service.BatchCreateFeaturesRequest(request)
1659+
# If we have keyword arguments corresponding to fields on the
1660+
# request, apply these.
1661+
if parent is not None:
1662+
request.parent = parent
1663+
if requests is not None:
1664+
request.requests = requests
1665+
1666+
# Wrap the RPC method; this adds retry and timeout information,
1667+
# and friendly error handling.
1668+
rpc = self._transport._wrapped_methods[self._transport.batch_create_features]
1669+
1670+
# Certain fields should be provided within the metadata header;
1671+
# add these here.
1672+
metadata = tuple(metadata) + (
1673+
gapic_v1.routing_header.to_grpc_metadata((("parent", request.parent),)),
1674+
)
1675+
1676+
# Validate the universe domain.
1677+
self._validate_universe_domain()
1678+
1679+
# Send the request.
1680+
response = rpc(
1681+
request,
1682+
retry=retry,
1683+
timeout=timeout,
1684+
metadata=metadata,
1685+
)
1686+
1687+
# Wrap the response in an operation future.
1688+
response = gac_operation.from_gapic(
1689+
response,
1690+
self._transport.operations_client,
1691+
featurestore_service.BatchCreateFeaturesResponse,
1692+
metadata_type=featurestore_service.BatchCreateFeaturesOperationMetadata,
1693+
)
1694+
1695+
# Done; return the response.
1696+
return response
1697+
15531698
def get_feature(
15541699
self,
15551700
request: Optional[Union[featurestore_service.GetFeatureRequest, dict]] = None,

google/cloud/aiplatform_v1/services/feature_registry_service/transports/base.py

+14
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ def _prep_wrapped_messages(self, client_info):
167167
default_timeout=None,
168168
client_info=client_info,
169169
),
170+
self.batch_create_features: gapic_v1.method.wrap_method(
171+
self.batch_create_features,
172+
default_timeout=None,
173+
client_info=client_info,
174+
),
170175
self.get_feature: gapic_v1.method.wrap_method(
171176
self.get_feature,
172177
default_timeout=None,
@@ -310,6 +315,15 @@ def create_feature(
310315
]:
311316
raise NotImplementedError()
312317

318+
@property
319+
def batch_create_features(
320+
self,
321+
) -> Callable[
322+
[featurestore_service.BatchCreateFeaturesRequest],
323+
Union[operations_pb2.Operation, Awaitable[operations_pb2.Operation]],
324+
]:
325+
raise NotImplementedError()
326+
313327
@property
314328
def get_feature(
315329
self,

0 commit comments

Comments
 (0)