Table of Contents
SageMakerFeatureStoreRuntime.
Client
¶A low-level client representing Amazon SageMaker Feature Store Runtime
Contains all data plane API operations and data types for the Amazon SageMaker Feature Store. Use this API to put, delete, and retrieve (get) features from a feature store.
Use the following operations to configure your OnlineStore
and OfflineStore
features, and to create and manage feature groups:
client = session.create_client('sagemaker-featurestore-runtime')
These are the available methods:
batch_get_record()
can_paginate()
close()
delete_record()
get_paginator()
get_record()
get_waiter()
put_record()
batch_get_record
(**kwargs)¶Retrieves a batch of Records
from a FeatureGroup
.
See also: AWS API Documentation
Request Syntax
response = client.batch_get_record(
Identifiers=[
{
'FeatureGroupName': 'string',
'RecordIdentifiersValueAsString': [
'string',
],
'FeatureNames': [
'string',
]
},
]
)
[REQUIRED]
A list of FeatureGroup
names, with their corresponding RecordIdentifier
value, and Feature name that have been requested to be retrieved in batch.
The identifier that identifies the batch of Records you are retrieving in a batch.
A FeatureGroupName
containing Records you are retrieving in a batch.
The value for a list of record identifiers in string format.
List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
{
'Records': [
{
'FeatureGroupName': 'string',
'RecordIdentifierValueAsString': 'string',
'Record': [
{
'FeatureName': 'string',
'ValueAsString': 'string'
},
]
},
],
'Errors': [
{
'FeatureGroupName': 'string',
'RecordIdentifierValueAsString': 'string',
'ErrorCode': 'string',
'ErrorMessage': 'string'
},
],
'UnprocessedIdentifiers': [
{
'FeatureGroupName': 'string',
'RecordIdentifiersValueAsString': [
'string',
],
'FeatureNames': [
'string',
]
},
]
}
Response Structure
A list of Records you requested to be retrieved in batch.
The output of Records that have been retrieved in a batch.
The FeatureGroupName
containing Records you retrieved in a batch.
The value of the record identifer in string format.
The Record
retrieved.
The value associated with a feature.
The name of a feature that a feature value corresponds to.
The value associated with a feature, in string format. Note that features types can be String, Integral, or Fractional. This value represents all three types as a string.
A list of errors that have occured when retrieving a batch of Records.
The error that has occurred when attempting to retrieve a batch of Records.
The name of the feature group that the record belongs to.
The value for the RecordIdentifier
in string format of a Record from a FeatureGroup
that is causing an error when attempting to be retrieved.
The error code of an error that has occured when attempting to retrieve a batch of Records. For more information on errors, see Errors .
The error message of an error that has occured when attempting to retrieve a record in the batch.
A unprocessed list of FeatureGroup
names, with their corresponding RecordIdentifier
value, and Feature name.
The identifier that identifies the batch of Records you are retrieving in a batch.
A FeatureGroupName
containing Records you are retrieving in a batch.
The value for a list of record identifiers in string format.
List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
Exceptions
can_paginate
(operation_name)¶Check if an operation can be paginated.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.True
if the operation can be paginated,
False
otherwise.close
()¶Closes underlying endpoint connections.
delete_record
(**kwargs)¶Deletes a Record
from a FeatureGroup
. A new record will show up in the OfflineStore
when the DeleteRecord
API is called. This record will have a value of True
in the is_deleted
column.
See also: AWS API Documentation
Request Syntax
response = client.delete_record(
FeatureGroupName='string',
RecordIdentifierValueAsString='string',
EventTime='string'
)
[REQUIRED]
The name of the feature group to delete the record from.
[REQUIRED]
The value for the RecordIdentifier
that uniquely identifies the record, in string format.
[REQUIRED]
Timestamp indicating when the deletion event occurred. EventTime
can be used to query data at a certain point in time.
None
Exceptions
get_paginator
(operation_name)¶Create a paginator for an operation.
create_foo
, and you'd normally invoke the
operation as client.create_foo(**kwargs)
, if the
create_foo
operation can be paginated, you can use the
call client.get_paginator("create_foo")
.client.can_paginate
method to
check if an operation is pageable.get_record
(**kwargs)¶Use for OnlineStore
serving from a FeatureStore
. Only the latest records stored in the OnlineStore
can be retrieved. If no Record with RecordIdentifierValue
is found, then an empty result is returned.
See also: AWS API Documentation
Request Syntax
response = client.get_record(
FeatureGroupName='string',
RecordIdentifierValueAsString='string',
FeatureNames=[
'string',
]
)
[REQUIRED]
The name of the feature group in which you want to put the records.
[REQUIRED]
The value that corresponds to RecordIdentifier
type and uniquely identifies the record in the FeatureGroup
.
List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.
dict
Response Syntax
{
'Record': [
{
'FeatureName': 'string',
'ValueAsString': 'string'
},
]
}
Response Structure
(dict) --
Record (list) --
The record you requested. A list of FeatureValues
.
(dict) --
The value associated with a feature.
FeatureName (string) --
The name of a feature that a feature value corresponds to.
ValueAsString (string) --
The value associated with a feature, in string format. Note that features types can be String, Integral, or Fractional. This value represents all three types as a string.
Exceptions
SageMakerFeatureStoreRuntime.Client.exceptions.ValidationError
SageMakerFeatureStoreRuntime.Client.exceptions.ResourceNotFound
SageMakerFeatureStoreRuntime.Client.exceptions.InternalFailure
SageMakerFeatureStoreRuntime.Client.exceptions.ServiceUnavailable
SageMakerFeatureStoreRuntime.Client.exceptions.AccessForbidden
get_waiter
(waiter_name)¶Returns an object that can wait for some condition.
put_record
(**kwargs)¶Used for data ingestion into the FeatureStore
. The PutRecord
API writes to both the OnlineStore
and OfflineStore
. If the record is the latest record for the recordIdentifier
, the record is written to both the OnlineStore
and OfflineStore
. If the record is a historic record, it is written only to the OfflineStore
.
See also: AWS API Documentation
Request Syntax
response = client.put_record(
FeatureGroupName='string',
Record=[
{
'FeatureName': 'string',
'ValueAsString': 'string'
},
]
)
[REQUIRED]
The name of the feature group that you want to insert the record into.
[REQUIRED]
List of FeatureValues to be inserted. This will be a full over-write. If you only want to update few of the feature values, do the following:
GetRecord
to retrieve the latest record.GetRecord
.PutRecord
to update feature values.The value associated with a feature.
The name of a feature that a feature value corresponds to.
The value associated with a feature, in string format. Note that features types can be String, Integral, or Fractional. This value represents all three types as a string.
None
Exceptions
Client exceptions are available on a client instance via the exceptions
property. For more detailed instructions and examples on the exact usage of client exceptions, see the error handling user guide.
The available client exceptions are:
SageMakerFeatureStoreRuntime.Client.exceptions.AccessForbidden
SageMakerFeatureStoreRuntime.Client.exceptions.InternalFailure
SageMakerFeatureStoreRuntime.Client.exceptions.ResourceNotFound
SageMakerFeatureStoreRuntime.Client.exceptions.ServiceUnavailable
SageMakerFeatureStoreRuntime.Client.exceptions.ValidationError
SageMakerFeatureStoreRuntime.Client.exceptions.
AccessForbidden
¶You do not have permission to perform an action.
Example
try:
...
except client.exceptions.AccessForbidden as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
You do not have permission to perform an action.
SageMakerFeatureStoreRuntime.Client.exceptions.
InternalFailure
¶An internal failure occurred. Try your request again. If the problem persists, contact AWS customer support.
Example
try:
...
except client.exceptions.InternalFailure as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
An internal failure occurred. Try your request again. If the problem persists, contact AWS customer support.
SageMakerFeatureStoreRuntime.Client.exceptions.
ResourceNotFound
¶A resource that is required to perform an action was not found.
Example
try:
...
except client.exceptions.ResourceNotFound as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
A resource that is required to perform an action was not found.
The service is currently unavailable.
Example
try:
...
except client.exceptions.ServiceUnavailable as e:
print(e.response)
The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
The service is currently unavailable.
SageMakerFeatureStoreRuntime.Client.exceptions.
ValidationError
¶There was an error validating your request.
Example
try:
...
except client.exceptions.ValidationError as e:
print(e.response)
response
¶The parsed error response. All exceptions have a top level Error
key that provides normalized access to common exception atrributes. All other keys are specific to this service or exception class.
Syntax
{
'Message': 'string',
'Error': {
'Code': 'string',
'Message': 'string'
}
}
Structure
(dict) --
There was an error validating your request.
The available paginators are: