Skip to content

Commit

Permalink
fix: removed monitoring config, add wildcard sample for batch read
Browse files Browse the repository at this point in the history
  • Loading branch information
lclc19 committed Sep 22, 2021
1 parent 80e8c4d commit 9dd3a7a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 23 deletions.
Expand Up @@ -24,7 +24,8 @@ def batch_create_features_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -41,11 +42,6 @@ def batch_create_features_sample(
feature=aiplatform.Feature(
value_type=aiplatform.Feature.ValueType.STRING,
description="User gender",
monitoring_config=aiplatform.FeaturestoreMonitoringConfig(
snapshot_analysis=aiplatform.FeaturestoreMonitoringConfig.SnapshotAnalysis(
disabled=True,
),
),
),
feature_id="gender",
),
Expand Down
Expand Up @@ -25,7 +25,8 @@ def batch_read_feature_values_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand All @@ -47,21 +48,14 @@ def batch_read_feature_values_sample(
# Read the 'age', 'gender' and 'liked_genres' features from the 'perm_users' entity
entity_type_id="perm_users",
feature_selector=aiplatform.FeatureSelector(
id_matcher=aiplatform.IdMatcher(
ids=[
# features, use "*" if you want to select all features within this entity type
"age",
"gender",
"liked_genres",
]
)
id_matcher=aiplatform.IdMatcher(ids=["age", "gender", "liked_genres"])
),
),
aiplatform.BatchReadFeatureValuesRequest.EntityTypeSpec(
# Read the 'average_rating' and 'genres' features from the 'perm_movies' entity
# Read the all features from the 'perm_movies' entity
entity_type_id="perm_movies",
feature_selector=aiplatform.FeatureSelector(
id_matcher=aiplatform.IdMatcher(ids=["average_rating", "genres"])
id_matcher=aiplatform.IdMatcher(ids=["*"])
),
),
]
Expand Down
Expand Up @@ -25,7 +25,8 @@ def create_entity_type_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -27,7 +27,8 @@ def create_feature_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -24,7 +24,8 @@ def create_featurestore_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -23,7 +23,8 @@ def delete_featurestore_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -28,7 +28,8 @@ def import_feature_values_sample(
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
timeout: int = 300,
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down
Expand Up @@ -24,7 +24,8 @@ def read_feature_values_sample(
location: str = "us-central1",
api_endpoint: str = "us-central1-aiplatform.googleapis.com",
):
# The AI Platform services require regional API endpoints.
# The AI Platform services require regional API endpoints, which need to be
# in the same region or multi-region overlap with the Feature Store location.
client_options = {"api_endpoint": api_endpoint}
# Initialize client that will be used to create and send requests.
# This client only needs to be created once, and can be reused for multiple requests.
Expand Down

0 comments on commit 9dd3a7a

Please sign in to comment.