You can update a feature group to register a BigQuery table or view as the feature data source for that feature group. If the feature group already has an associated data source, you can associate a different BigQuery table or view as the feature data source.
While creating or updating a feature group, you have the option to add user-defined metadata in the form of labels to the feature group. For more information about how to update user-defined labels for a feature group, see Update labels for a feature group.
Use the following sample to update a feature group.
REST
To update a FeatureGroup
resource, send a PATCH
request by using the
featureGroups.patch
method.
Before using any of the request data, make the following replacements:
- LOCATION_ID: Region where the feature group is located, such as
us-central1
. - PROJECT_ID: Your project ID.
- FEATURE_GROUP_NAME: The name of the feature group that you want to update.
- BIGQUERY_SOURCE_URI: URI of the BigQuery source table or view that you want to associate with the feature group.
HTTP method and URL:
PATCH http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATURE_GROUP_NAME
Request JSON body:
{ "big_query": { "big_query_source": { "input_uri": "BIGQUERY_SOURCE_URI" } } }
To send your request, choose one of these options:
curl
Save the request body in a file named request.json
,
and execute the following command:
curl -X PATCH \
-H "Authorization: Bearer $(gcloud auth print-access-token)" \
-H "Content-Type: application/json; charset=utf-8" \
-d @request.json \
"http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATURE_GROUP_NAME"
PowerShell
Save the request body in a file named request.json
,
and execute the following command:
$cred = gcloud auth print-access-token
$headers = @{ "Authorization" = "Bearer $cred" }
Invoke-WebRequest `
-Method PATCH `
-Headers $headers `
-ContentType: "application/json; charset=utf-8" `
-InFile request.json `
-Uri "http://LOCATION_ID-aiplatform.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION_ID/featureGroups?feature_group_id=FEATURE_GROUP_NAME" | Select-Object -Expand Content
You should receive a JSON response similar to the following:
{ "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME/operations/OPERATION_ID", "metadata": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.UpdateFeatureGroupOperationMetadata", "genericMetadata": { "createTime": "2023-09-18T03:00:13.060636Z", "updateTime": "2023-09-18T03:00:13.060636Z" } }, "done": true, "response": { "@type": "type.googleapis.com/google.cloud.aiplatform.v1.FeatureGroup", "name": "projects/PROJECT_NUMBER/locations/LOCATION_ID/featureGroups/FEATURE_GROUP_NAME" } }
What's next
Learn how to update a feature view.
Learn how to update a feature.
Learn how to delete a feature group.