Skip to content

update_dataset_group async

update_dataset_group(
    dataset_group_arn: Arn,
    dataset_arns: ArnList,
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
) -> UpdateDatasetGroupResponse

Replaces the datasets in a dataset group with the specified datasets.

The Status of the dataset group must be ACTIVE before you can use the dataset group to create a predictor. Use the DescribeDatasetGroup operation to get the status.

Parameters:

  • dataset_group_arn (Arn) –

    The ARN of the dataset group.

  • dataset_arns (ArnList) –

    An array of the Amazon Resource Names (ARNs) of the datasets to add to the dataset group.

Raises:

Source code in docs_src/capo_forecast/_services/async_forecast.py
async def update_dataset_group(
    self,
    dataset_group_arn: "capo_forecast.types.arn.Arn",
    dataset_arns: "capo_forecast.types.arn_list.ArnList",
    *,
    config_overrides: Optional[AsyncforecastClientConfig] = None,
) -> "capo_forecast.types.update_dataset_group_response.UpdateDatasetGroupResponse":
    """<p>Replaces the datasets in a dataset group with the specified datasets.</p> <note> <p>The <code>Status</code> of the dataset group must be <code>ACTIVE</code> before you can use the dataset group to create a predictor. Use the <a href="https://docs.aws.amazon.com/forecast/latest/dg/API_DescribeDatasetGroup.html">DescribeDatasetGroup</a> operation to get the status.</p> </note>

    Args:
        dataset_group_arn: <p>The ARN of the dataset group.</p>
        dataset_arns: <p>An array of the Amazon Resource Names (ARNs) of the datasets to add to the dataset group.</p>

    Raises:
        capo_forecast.errors.invalid_input_exception.InvalidInputException: <p>We can't process the request because it includes an invalid value or a value that exceeds the valid range.</p>
        capo_forecast.errors.resource_in_use_exception.ResourceInUseException: <p>The specified resource is in use.</p>
        capo_forecast.errors.resource_not_found_exception.ResourceNotFoundException: <p>We can't find a resource with that Amazon Resource Name (ARN). Check the ARN and try again.</p>
        capo_forecast.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_forecast.types.update_dataset_group_request.UpdateDatasetGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_forecast.types.update_dataset_group_response.UpdateDatasetGroupResponse"
    ]:
        import capo_forecast._operations.amazon_forecast.update_dataset_group

        (
            output,
            http_response,
        ) = await capo_forecast._operations.amazon_forecast.update_dataset_group.async_update_dataset_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdateDatasetGroup")
    )
    input_: capo_forecast.types.update_dataset_group_request.UpdateDatasetGroupRequest = {
        "dataset_group_arn": dataset_group_arn,
        "dataset_arns": dataset_arns,
    }

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output