aws / sagemaker-core

Apache License 2.0
5 stars 3 forks source link

While creating a feature store group, create method is not taking OnlineStore configuration into consideration #175

Closed A-yush closed 1 month ago

A-yush commented 1 month ago

from sagemaker_core.shapes import OnlineStoreConfig,OfflineStoreConfig,S3StorageConfig from sagemaker_core.resources import FeatureGroup

FeatureGroup.create(
    feature_group_name= customers_feature_group_name,
    #s3_uri=f"s3://{s3_bucket_name}/{prefix}",
    record_identifier_feature_name= record_identifier_feature_name,
    event_time_feature_name="EventTime",
    role_arn=role,
    online_store_config = OnlineStoreConfig(enable_store_config=True),
    feature_definitions = CustomerFeatureDefinitions
)

Error: ClientError: An error occurred (ValidationException) when calling the CreateFeatureGroup operation: Validation Error: OnlineStore and OfflineStore cannot be both disabled. Please enable at least one of them and retry the request.

Issue is that while creating a feature group, it's not taking the online_store_config parameter into consideration. When I just set the enable_store_config to True it gives ValidationException.

When I provide both OnlineStore and OfflineStore, the feature store gets created but the type is only offline mode showing it's not taking OnlineStore configuration into consideration.

Example code when providing both OnlineStore and OfflineStore.

from sagemaker_core.shapes import OnlineStoreConfig,OfflineStoreConfig,S3StorageConfig from sagemaker_core.resources import FeatureGroup

FeatureGroup.create(
    feature_group_name= customers_feature_group_name,
    #s3_uri=f"s3://{s3_bucket_name}/{prefix}",
    record_identifier_feature_name= record_identifier_feature_name,
    event_time_feature_name="EventTime",
    role_arn=role,
    online_store_config = OnlineStoreConfig(enable_store_config=True),
    feature_definitions = CustomerFeatureDefinitions,
    offline_store_config = OfflineStoreConfig(s3_storage_config = S3StorageConfig(s3_uri = f"s3://{s3_bucket_name}/{prefix}"))
)