Skip to content

get_record

get_record(
    feature_group_name: FeatureGroupNameOrArn,
    *,
    config_overrides: Optional[SageMakerFeatureStoreRuntimeClientConfig] = None,
    record_identifier_value_as_string: Optional[ValueAsString] = None,
    feature_names: Optional[FeatureNames] = None,
    expiration_time_response: Optional[ExpirationTimeResponse] = None,
) -> GetRecordResponse

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.

Parameters:

  • feature_group_name (FeatureGroupNameOrArn) –

    The name or Amazon Resource Name (ARN) of the feature group from which you want to retrieve a record.

  • record_identifier_value_as_string (Optional[ValueAsString], default: None ) –

    The value that corresponds to RecordIdentifier type and uniquely identifies the record in the FeatureGroup.

  • feature_names (Optional[FeatureNames], default: None ) –

    List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.

  • expiration_time_response (Optional[ExpirationTimeResponse], default: None ) –

    Parameter to request ExpiresAt in response. If Enabled, GetRecord will return the value of ExpiresAt, if it is not null. If Disabled and null, GetRecord will return null.

Raises:

  • AccessForbidden –

    You do not have permission to perform an action.

  • InternalFailure –

    An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.

  • ResourceNotFound –

    A resource that is required to perform an action was not found.

  • ServiceUnavailable –

    The service is currently unavailable.

  • ValidationError –

    There was an error validating your request.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_sagemaker_featurestore_runtime/_services/sage_maker_feature_store_runtime.py
def get_record(
    self,
    feature_group_name: "capo_sagemaker_featurestore_runtime.types.feature_group_name_or_arn.FeatureGroupNameOrArn",
    *,
    config_overrides: Optional[SageMakerFeatureStoreRuntimeClientConfig] = None,
    record_identifier_value_as_string: Optional[
        "capo_sagemaker_featurestore_runtime.types.value_as_string.ValueAsString"
    ] = None,
    feature_names: Optional[
        "capo_sagemaker_featurestore_runtime.types.feature_names.FeatureNames"
    ] = None,
    expiration_time_response: Optional[
        "capo_sagemaker_featurestore_runtime.types.expiration_time_response.ExpirationTimeResponse"
    ] = None,
) -> "capo_sagemaker_featurestore_runtime.types.get_record_response.GetRecordResponse":
    """<p>Use for <code>OnlineStore</code> serving from a <code>FeatureStore</code>. Only the latest records stored in the <code>OnlineStore</code> can be retrieved. If no Record with <code>RecordIdentifierValue</code> is found, then an empty result is returned. </p>

    Args:
        feature_group_name: <p>The name or Amazon Resource Name (ARN) of the feature group from which you want to retrieve a record.</p>
        record_identifier_value_as_string: <p>The value that corresponds to <code>RecordIdentifier</code> type and uniquely identifies the record in the <code>FeatureGroup</code>. </p>
        feature_names: <p>List of names of Features to be retrieved. If not specified, the latest value for all the Features are returned.</p>
        expiration_time_response: <p>Parameter to request <code>ExpiresAt</code> in response. If <code>Enabled</code>, <code>GetRecord</code> will return the value of <code>ExpiresAt</code>, if it is not null. If <code>Disabled</code> and null, <code>GetRecord</code> will return null.</p>

    Raises:
        capo_sagemaker_featurestore_runtime.errors.access_forbidden.AccessForbidden: <p>You do not have permission to perform an action.</p>
        capo_sagemaker_featurestore_runtime.errors.internal_failure.InternalFailure: <p>An internal failure occurred. Try your request again. If the problem persists, contact Amazon Web Services customer support.</p>
        capo_sagemaker_featurestore_runtime.errors.resource_not_found.ResourceNotFound: <p>A resource that is required to perform an action was not found.</p>
        capo_sagemaker_featurestore_runtime.errors.service_unavailable.ServiceUnavailable: <p>The service is currently unavailable.</p>
        capo_sagemaker_featurestore_runtime.errors.validation_error.ValidationError: <p>There was an error validating your request.</p>
        capo_sagemaker_featurestore_runtime.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker_featurestore_runtime.types.get_record_request.GetRecordRequest]",
    ) -> OperationResponse[
        "capo_sagemaker_featurestore_runtime.types.get_record_response.GetRecordResponse"
    ]:
        import capo_sagemaker_featurestore_runtime._operations.amazon_sage_maker_feature_store_runtime.get_record

        output, http_response = (
            capo_sagemaker_featurestore_runtime._operations.amazon_sage_maker_feature_store_runtime.get_record.get_record(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetRecord")
    )
    input_: capo_sagemaker_featurestore_runtime.types.get_record_request.GetRecordRequest = {
        "feature_group_name": feature_group_name
    }
    if record_identifier_value_as_string is not None:
        input_["record_identifier_value_as_string"] = (
            record_identifier_value_as_string
        )
    if feature_names is not None:
        input_["feature_names"] = feature_names
    if expiration_time_response is not None:
        input_["expiration_time_response"] = expiration_time_response

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output