Skip to content

update_trial_component

update_trial_component(
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[ExperimentEntityName] = None,
    display_name: Optional[ExperimentEntityName] = None,
    status: Optional[TrialComponentStatus] = None,
    start_time: Optional[Timestamp] = None,
    end_time: Optional[Timestamp] = None,
    parameters: Optional[TrialComponentParameters] = None,
    parameters_to_remove: Optional[ListTrialComponentKey256] = None,
    input_artifacts: Optional[TrialComponentArtifacts] = None,
    input_artifacts_to_remove: Optional[ListTrialComponentKey256] = None,
    output_artifacts: Optional[TrialComponentArtifacts] = None,
    output_artifacts_to_remove: Optional[ListTrialComponentKey256] = None,
) -> UpdateTrialComponentResponse

Updates one or more properties of a trial component.

Parameters:

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

    The name of the component to update.

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

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

  • status (Optional[TrialComponentStatus], default: None ) –

    The new status of the component.

  • start_time (Optional[Timestamp], default: None ) –

    When the component started.

  • end_time (Optional[Timestamp], default: None ) –

    When the component ended.

  • parameters (Optional[TrialComponentParameters], default: None ) –

    Replaces all of the component's hyperparameters with the specified hyperparameters or add new hyperparameters. Existing hyperparameters are replaced if the trial component is updated with an identical hyperparameter key.

  • parameters_to_remove (Optional[ListTrialComponentKey256], default: None ) –

    The hyperparameters to remove from the component.

  • input_artifacts (Optional[TrialComponentArtifacts], default: None ) –

    Replaces all of the component's input artifacts with the specified artifacts or adds new input artifacts. Existing input artifacts are replaced if the trial component is updated with an identical input artifact key.

  • input_artifacts_to_remove (Optional[ListTrialComponentKey256], default: None ) –

    The input artifacts to remove from the component.

  • output_artifacts (Optional[TrialComponentArtifacts], default: None ) –

    Replaces all of the component's output artifacts with the specified artifacts or adds new output artifacts. Existing output artifacts are replaced if the trial component is updated with an identical output artifact key.

  • output_artifacts_to_remove (Optional[ListTrialComponentKey256], default: None ) –

    The output artifacts to remove from the component.

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_component(
    self,
    *,
    config_overrides: Optional[SageMakerClientConfig] = None,
    trial_component_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    display_name: Optional[
        "capo_sagemaker.types.experiment_entity_name.ExperimentEntityName"
    ] = None,
    status: Optional[
        "capo_sagemaker.types.trial_component_status.TrialComponentStatus"
    ] = None,
    start_time: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    end_time: Optional["capo_sagemaker.types.timestamp.Timestamp"] = None,
    parameters: Optional[
        "capo_sagemaker.types.trial_component_parameters.TrialComponentParameters"
    ] = None,
    parameters_to_remove: Optional[
        "capo_sagemaker.types.list_trial_component_key256.ListTrialComponentKey256"
    ] = None,
    input_artifacts: Optional[
        "capo_sagemaker.types.trial_component_artifacts.TrialComponentArtifacts"
    ] = None,
    input_artifacts_to_remove: Optional[
        "capo_sagemaker.types.list_trial_component_key256.ListTrialComponentKey256"
    ] = None,
    output_artifacts: Optional[
        "capo_sagemaker.types.trial_component_artifacts.TrialComponentArtifacts"
    ] = None,
    output_artifacts_to_remove: Optional[
        "capo_sagemaker.types.list_trial_component_key256.ListTrialComponentKey256"
    ] = None,
) -> "capo_sagemaker.types.update_trial_component_response.UpdateTrialComponentResponse":
    """<p>Updates one or more properties of a trial component.</p>

    Args:
        trial_component_name: <p>The name of the component to update.</p>
        display_name: <p>The name of the component as displayed. The name doesn't need to be unique. If <code>DisplayName</code> isn't specified, <code>TrialComponentName</code> is displayed.</p>
        status: <p>The new status of the component.</p>
        start_time: <p>When the component started.</p>
        end_time: <p>When the component ended.</p>
        parameters: <p>Replaces all of the component's hyperparameters with the specified hyperparameters or add new hyperparameters. Existing hyperparameters are replaced if the trial component is updated with an identical hyperparameter key.</p>
        parameters_to_remove: <p>The hyperparameters to remove from the component.</p>
        input_artifacts: <p>Replaces all of the component's input artifacts with the specified artifacts or adds new input artifacts. Existing input artifacts are replaced if the trial component is updated with an identical input artifact key.</p>
        input_artifacts_to_remove: <p>The input artifacts to remove from the component.</p>
        output_artifacts: <p>Replaces all of the component's output artifacts with the specified artifacts or adds new output artifacts. Existing output artifacts are replaced if the trial component is updated with an identical output artifact key.</p>
        output_artifacts_to_remove: <p>The output artifacts to remove from the component.</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_component_request.UpdateTrialComponentRequest]",
    ) -> OperationResponse[
        "capo_sagemaker.types.update_trial_component_response.UpdateTrialComponentResponse"
    ]:
        import capo_sagemaker._operations.sage_maker.update_trial_component

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateTrialComponent")
    )
    input_: capo_sagemaker.types.update_trial_component_request.UpdateTrialComponentRequest = {}
    if trial_component_name is not None:
        input_["trial_component_name"] = trial_component_name
    if display_name is not None:
        input_["display_name"] = display_name
    if status is not None:
        input_["status"] = status
    if start_time is not None:
        input_["start_time"] = start_time
    if end_time is not None:
        input_["end_time"] = end_time
    if parameters is not None:
        input_["parameters"] = parameters
    if parameters_to_remove is not None:
        input_["parameters_to_remove"] = parameters_to_remove
    if input_artifacts is not None:
        input_["input_artifacts"] = input_artifacts
    if input_artifacts_to_remove is not None:
        input_["input_artifacts_to_remove"] = input_artifacts_to_remove
    if output_artifacts is not None:
        input_["output_artifacts"] = output_artifacts
    if output_artifacts_to_remove is not None:
        input_["output_artifacts_to_remove"] = output_artifacts_to_remove

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