Skip to content

disassociate_trial_component

disassociate_trial_component(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[ExperimentEntityName] = None,
    trial_name: Optional[ExperimentEntityName] = None,
) -> DisassociateTrialComponentResponse

Disassociates a trial component from a trial. This doesn't effect other trials the component is associated with. Before you can delete a component, you must disassociate the component from all trials it is associated with. To associate a trial component with a trial, call the AssociateTrialComponent API.

To get a list of the trials a component is associated with, use the Search API. Specify ExperimentTrialComponent for the Resource parameter. The list appears in the response under Results.TrialComponent.Parents.

Parameters:

Raises:

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def disassociate_trial_component(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    trial_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
) -> "capo_sagemaker.types.disassociate_trial_component_response.DisassociateTrialComponentResponse":
    """<p>Disassociates a trial component from a trial. This doesn't effect other trials the component is associated with. Before you can delete a component, you must disassociate the component from all trials it is associated with. To associate a trial component with a trial, call the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_AssociateTrialComponent.html">AssociateTrialComponent</a> API.</p> <p>To get a list of the trials a component is associated with, use the <a href="https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_Search.html">Search</a> API. Specify <code>ExperimentTrialComponent</code> for the <code>Resource</code> parameter. The list appears in the response under <code>Results.TrialComponent.Parents</code>.</p>

    Args:
        trial_component_name: <p>The name of the component to disassociate from the trial.</p>
        trial_name: <p>The name of the trial to disassociate from.</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.disassociate_trial_component_request.DisassociateTrialComponentRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.disassociate_trial_component_response.DisassociateTrialComponentResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.disassociate_trial_component

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DisassociateTrialComponent")
    )
    input_: capo_sagemaker.types.disassociate_trial_component_request.DisassociateTrialComponentRequest = {}
    if trial_component_name is not None:
        input_["trial_component_name"] = trial_component_name
    if trial_name is not None:
        input_["trial_name"] = trial_name

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