PDS 2 - Week 1 Exercise 3 - Query the Feature Store

I am getting below error while execution

feature_store_query = feature_group.athena_query()

feature_store_table = feature_store_query.table_name

query_string = “”"
SELECT date,
review_id,
sentiment,
label_id,
input_ids,
review_body
FROM “{}”
WHERE split_type=‘train’
LIMIT 5
“”".format(feature_store_table)

print(‘Glue Catalog table name: {}’.format(feature_store_table))
print(‘Running query: {}’.format(query_string))

Error


ClientError Traceback (most recent call last)
in
----> 1 feature_store_query = feature_group.athena_query()
2
3 feature_store_table = feature_store_query.table_name
4
5 query_string = “”"

/opt/conda/lib/python3.7/site-packages/sagemaker/feature_store/feature_group.py in athena_query(self)
481 An instance of AthenaQuery initialized with data catalog configurations.
482 “”"
→ 483 response = self.describe()
484 data_catalog_config = response.get(“OfflineStoreConfig”).get(“DataCatalogConfig”, None)
485 disable_glue = data_catalog_config.get(“DisableGlueTableCreation”, False)

/opt/conda/lib/python3.7/site-packages/sagemaker/feature_store/feature_group.py in describe(self, next_token)
393 “”"
394 return self.sagemaker_session.describe_feature_group(
→ 395 feature_group_name=self.name, next_token=next_token
396 )
397

/opt/conda/lib/python3.7/site-packages/sagemaker/session.py in describe_feature_group(self, feature_group_name, next_token)
3904 kwargs = dict(FeatureGroupName=feature_group_name)
3905 update_args(kwargs, NextToken=next_token)
→ 3906 return self.sagemaker_client.describe_feature_group(**kwargs)
3907
3908 def put_record(

/opt/conda/lib/python3.7/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
384 "s() only accepts keyword arguments." py_operation_name)
385 # The “self” in this scope is referring to the BaseClient.
→ 386 return self._make_api_call(operation_name, kwargs)
387
388 _api_call.name = str(py_operation_name)

/opt/conda/lib/python3.7/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
703 error_code = parsed_response.get(“Error”, {}).get(“Code”)
704 error_class = self.exceptions.from_code(error_code)
→ 705 raise error_class(parsed_response, operation_name)
706 else:
707 return parsed_response

ClientError: An error occurred (ValidationException) when calling the DescribeFeatureGroup operation: 1 validation error detected: Value ‘feature_group_name’ at ‘featureGroupName’ failed to satisfy constraint: Member must satisfy regular expression pattern: ^a-zA-Z0-9{0,63}

Hello @AmitK604 and welcome to PDS,

By the error logs ir seems to be a problem with the value of the feature_group_name.
Can you , please, show the result of the following:

print('Feature group name: {}'.format(feature_group_name))

Let’s start by checking the name of the feature_group_name.

regards,