Skip to content

update_trial

update_trial(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_name: Optional[ExperimentEntityName] = None,
    display_name: Optional[ExperimentEntityName] = None,
) -> UpdateTrialResponse

Updates the display name of a trial.

Parameters:

  • trial_name (Optional[ExperimentEntityName], default: None ) –

    The name of the trial to update.

  • display_name (Optional[ExperimentEntityName], default: None ) –

    The name of the trial as displayed. The name doesn't need to be unique. If DisplayName isn't specified, TrialName is displayed.

Raises:

  • ConflictException –

    There was a conflict when you attempted to modify a SageMaker entity such as an Experiment or Artifact.

  • ResourceNotFound –

    Resource being access is not found.

  • UnknownServiceError –

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

Source code in docs_src/capo_sagemaker/_services/sage_maker.py
def update_trial(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    display_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
) -> "capo_sagemaker.types.update_trial_response.UpdateTrialResponse":
    """<p>Updates the display name of a trial.</p>

    Args:
        trial_name: <p>The name of the trial to update.</p>
        display_name: <p>The name of the trial as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialName</code> is displayed.</p>

    Raises:
        capo_sagemaker.errors.conflict_exception.ConflictException: <p>There was a conflict when you attempted to modify a SageMaker entity such as an <code>Experiment</code> or <code>Artifact</code>.</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_trial_request.UpdateTrialRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_trial_response.UpdateTrialResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_trial

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTrial")
    )
    input_: capo_sagemaker.types.update_trial_request.UpdateTrialRequest = {}
    if trial_name is not None:
        input_["trial_name"] = trial_name
    if display_name is not None:
        input_["display_name"] = display_name

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