Skip to content

delete_trial_component

delete_trial_component(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[ExperimentEntityName] = None,
) -> DeleteTrialComponentResponse

Deletes the specified trial component. A trial component must be disassociated from all trials before the trial component can be deleted. To disassociate a trial component from a trial, call the DisassociateTrialComponent API.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def delete_trial_component(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
) -> "capo_sagemaker.types.delete_trial_component_response.DeleteTrialComponentResponse":
    """<p>Deletes the specified trial component. A trial component must be disassociated from all trials before the trial component can be deleted. To disassociate a trial component from a trial, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_DisassociateTrialComponent.html">DisassociateTrialComponent</a> API.</p>

    Args:
        trial_component_name: <p>The name of the component to delete.</p>

    Raises:
        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.delete_trial_component_request.DeleteTrialComponentRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.delete_trial_component_response.DeleteTrialComponentResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.delete_trial_component

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DeleteTrialComponent")
    )
    input_: capo_sagemaker.types.delete_trial_component_request.DeleteTrialComponentRequest = {}
    if trial_component_name is not None:
        input_["trial_component_name"] = trial_component_name

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