Closed oonisim closed 10 months ago
got same issues. Does it solve ?
I am facing the same issue, any lead for the solution. can someone help me with another way of ingesting data to feature group.
This look like a service issue, not SDK's.
@Pooja-Karangale would you have some IDs of failed requests, along with time and region that can help us debug ?
EDIT: Looks like boto3 won't log request IDs even for exceptional cases unless verbose logging is enabled. If you have request IDs, please share them here. Otherwise, open a case with AWS support where you can share more sensitive details like Account ID that'll help with the investigation.
Does anyone know if this was fixed or if there is a workaround? I have the same problem
If you see this issue consistently, please share the request IDs, region and a timeframe when you encountered this issue. Alternatively, you can open a case with AWS support to provide more sensitive details.
Thank you for opening this issue. Closing this issue as per the above comment. Please feel free to reopen if you continue to see this issue with the latest sagemaker version.
Describe the bug Feature Group ingest method fails to insert several records sporadically and throws an exception
Failed to ingest row 0: An error occurred (ValidationError) when calling the PutRecord operation: Resource Not Found: Amazon SageMaker can't find a FeatureGroup with name
although the FeatureGroup exists. Sometime one record, sometime multiple records, and there is no specific pattern.Querying from the Feature Group returns records, so the FeatureGroup is there and records have been inserted.
To reproduce
feature_group.ingest(...)
causes the exception in the SageMaker studio.import sagemaker from sagemaker.session import Session from sagemaker import get_execution_role
NUM_CPUS = multiprocessing.cpu_count() role = get_execution_role() session = sagemaker.Session() region = session.boto_region_name bucket = session.default_bucket()
from sagemaker.feature_store.feature_definition import ( FeatureDefinition, FeatureTypeEnum, )
feature_definitions = [ FeatureDefinition(feature_name="review_id", feature_type=FeatureTypeEnum.STRING), FeatureDefinition(feature_name="review_date", feature_type=FeatureTypeEnum.STRING), FeatureDefinition(feature_name="star_rating", feature_type=FeatureTypeEnum.INTEGRAL), ]
feature_group_prefix = "sagemaker-feature-group" feature_group_name = "amazon-product-review" feature_group_offline_uri = f"s3://{bucket}/{feature_group_prefix}/{feature_group_name}/features" feature_group_query_uri = f"s3://{bucket}/{feature_group_prefix}/{feature_group_name}/queries"
record_identifier_feature_name = "review_id" event_time_feature_name = "review_date"
from sagemaker.feature_store.feature_group import FeatureGroup
feature_group = FeatureGroup( name=feature_group_name, feature_definitions=feature_definitions, sagemaker_session=session )
def wait_for_feature_group_creation_complete(feature_group): status = feature_group.describe().get("FeatureGroupStatus") print("Waiting for Feature Group Creation") print("Feature Group status: {}".format(status)) while status == "Creating": time.sleep(5) status = feature_group.describe().get("FeatureGroupStatus") print("Feature Group status: {}".format(status))
try: print("Creating Feature Group with role {}...".format(role)) response = feature_group.create( s3_uri=feature_group_offline_uri, record_identifier_name=record_identifier_feature_name, event_time_feature_name=event_time_feature_name, role_arn=role, enable_online_store=True, )
except Exception as e: raise RuntimeError("Feature Group creation failed: {}".format(e)) from e
client = session.boto_session.client( "sagemaker", region_name=region ) client.list_feature_groups() feature_group.describe()
import pandas as pd import s3fs
amazon_product_review_bucket = "amazon-reviews-pds" generator = pd.read_csv( f"s3://{amazon_product_review_bucket}/tsv/amazon_reviews_us_Digital_Software_v1_00.tsv.gz", header=0, usecols=["review_id", "star_rating", "review_date"], parse_dates=["review_date"], sep='\t', compression="gzip", chunksize=1024 (NUM_CPUS -1) 3 )
df = next(generator) df.dropna(inplace=True) df['review_date'] = df['review_date'].dt.strftime('%Y-%m-%dT%H:%M:%SZ') df.head()
feature_group.describe() feature_group.ingest( # <---------- Cause the error data_frame = df, max_processes=1, max_workers=3, wait=True )
feature_store_query = feature_group.athena_query() feature_store_table = feature_store_query.table_name
query_string = """ SELECT review_id, star_rating, review_date FROM "{}" LIMIT 10 """.format( feature_store_table )
print("Running " + query_string)
feature_store_query.run( query_string=query_string, output_location=feature_group_query_uri, )
feature_store_query.wait() feature_store_query.as_dataframe()
Failed to ingest row 0: An error occurred (ValidationError) when calling the PutRecord operation: Resource Not Found: Amazon SageMaker can't find a FeatureGroup with name [amazon-product-review]. Failed to ingest row 0 to 1024
IngestionError Traceback (most recent call last)