Skip to content

update_feature_group

update_feature_group(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    feature_group_name: Optional[FeatureGroupNameOrArn] = None,
    feature_additions: Optional[FeatureAdditions] = None,
    online_store_config: Optional[OnlineStoreConfigUpdate] = None,
    throughput_config: Optional[ThroughputConfigUpdate] = None,
) -> UpdateFeatureGroupResponse

Updates the feature group by either adding features or updating the online store configuration. Use one of the following request parameters at a time while using the UpdateFeatureGroup API.

You can add features for your feature group using the FeatureAdditions request parameter. Features cannot be removed from a feature group.

You can update the online store configuration by using the OnlineStoreConfig request parameter. If a TtlDuration is specified, the default TtlDuration applies for all records added to the feature group after the feature group is updated. If a record level TtlDuration exists from using the PutRecord API, the record level TtlDuration applies to that record instead of the default TtlDuration. To remove the default TtlDuration from an existing feature group, use the UpdateFeatureGroup API and set the TtlDuration Unit and Value to null.

Parameters:

  • feature_group_name (Optional[FeatureGroupNameOrArn], default: None ) –

    The name or Amazon Resource Name (ARN) of the feature group that you're updating.

  • feature_additions (Optional[FeatureAdditions], default: None ) –

    Updates the feature group. Updating a feature group is an asynchronous operation. When you get an HTTP 200 response, you've made a valid request. It takes some time after you've made a valid request for Feature Store to update the feature group.

  • online_store_config (Optional[OnlineStoreConfigUpdate], default: None ) –

    Updates the feature group online store configuration.

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_feature_group(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    feature_group_name: Optional[
        "capo_sagemaker.types.feature_group_name_or_arn.FeatureGroupNameOrArn"
    ] = None,
    feature_additions: Optional[
        "capo_sagemaker.types.feature_additions.FeatureAdditions"
    ] = None,
    online_store_config: Optional[
        "capo_sagemaker.types.online_store_config_update.OnlineStoreConfigUpdate"
    ] = None,
    throughput_config: Optional[
        "capo_sagemaker.types.throughput_config_update.ThroughputConfigUpdate"
    ] = None,
) -> (
    "capo_sagemaker.types.update_feature_group_response.UpdateFeatureGroupResponse"
):
    """<p>Updates the feature group by either adding features or updating the online store configuration. Use one of the following request parameters at a time while using the <code>UpdateFeatureGroup</code> API.</p> <p>You can add features for your feature group using the <code>FeatureAdditions</code> request parameter. Features cannot be removed from a feature group.</p> <p>You can update the online store configuration by using the <code>OnlineStoreConfig</code> request parameter. If a <code>TtlDuration</code> is specified, the default <code>TtlDuration</code> applies for all records added to the feature group <i>after the feature group is updated</i>. If a record level <code>TtlDuration</code> exists from using the <code>PutRecord</code> API, the record level <code>TtlDuration</code> applies to that record instead of the default <code>TtlDuration</code>. To remove the default <code>TtlDuration</code> from an existing feature group, use the <code>UpdateFeatureGroup</code> API and set the <code>TtlDuration</code> <code>Unit</code> and <code>Value</code> to <code>null</code>.</p>

    Args:
        feature_group_name: <p>The name or Amazon Resource Name (ARN) of the feature group that you're updating.</p>
        feature_additions: <p>Updates the feature group. Updating a feature group is an asynchronous operation. When you get an HTTP 200 response, you've made a valid request. It takes some time after you've made a valid request for Feature Store to update the feature group.</p>
        online_store_config: <p>Updates the feature group online store configuration.</p>

    Raises:
        capo_sagemaker.errors.resource_limit_exceeded.ResourceLimitExceeded: <p> You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created. </p>
        capo_sagemaker.errors.resource_not_found.ResourceNotFound: <p>Resource being access is not found.</p>
        capo_sagemaker.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_sagemaker.types.update_feature_group_request.UpdateFeatureGroupRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_feature_group_response.UpdateFeatureGroupResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_feature_group

        output, http_response = (
            capo_sagemaker._operations.sage_maker.update_feature_group.update_feature_group(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateFeatureGroup")
    )
    input_: capo_sagemaker.types.update_feature_group_request.UpdateFeatureGroupRequest = {}
    if feature_group_name is not None:
        input_["feature_group_name"] = feature_group_name
    if feature_additions is not None:
        input_["feature_additions"] = feature_additions
    if online_store_config is not None:
        input_["online_store_config"] = online_store_config
    if throughput_config is not None:
        input_["throughput_config"] = throughput_config

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