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/async_sage_maker.py
| async def delete_trial_component(
self,
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = 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.
"""
async def _handler(
req: "AsyncOperationRequest[capo_sagemaker.types.delete_trial_component_request.DeleteTrialComponentRequest]",
) -> AsyncOperationResponse[
"capo_sagemaker.types.delete_trial_component_response.DeleteTrialComponentResponse"
]:
import capo_sagemaker._operations.sage_maker.delete_trial_component
(
output,
http_response,
) = await capo_sagemaker._operations.sage_maker.delete_trial_component.async_delete_trial_component(
req.options, req.input
)
return AsyncOperationResponse(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 = await aexecute_pipeline(
AsyncOperationRequest(input=input_, options=options_),
handler=_handler,
interceptors=list(interceptors_),
)
await response.response.aclose()
return response.output
|