Skip to content

update_prepared_statement async

update_prepared_statement(
    statement_name: StatementName,
    work_group: WorkGroupName,
    query_statement: QueryString,
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    description: Optional[DescriptionString] = None,
) -> UpdatePreparedStatementOutput

Updates a prepared statement.

Parameters:

  • statement_name (StatementName) –

    The name of the prepared statement.

  • work_group (WorkGroupName) –

    The workgroup for the prepared statement.

  • query_statement (QueryString) –

    The query string for the prepared statement.

  • description (Optional[DescriptionString], default: None ) –

    The description of the prepared statement.

Raises:

Source code in docs_src/capo_athena/_services/async_athena.py
async def update_prepared_statement(
    self,
    statement_name: "capo_athena.types.statement_name.StatementName",
    work_group: "capo_athena.types.work_group_name.WorkGroupName",
    query_statement: "capo_athena.types.query_string.QueryString",
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    description: Optional[
        "capo_athena.types.description_string.DescriptionString"
    ] = None,
) -> "capo_athena.types.update_prepared_statement_output.UpdatePreparedStatementOutput":
    """<p>Updates a prepared statement.</p>

    Args:
        statement_name: <p>The name of the prepared statement.</p>
        work_group: <p>The workgroup for the prepared statement.</p>
        query_statement: <p>The query string for the prepared statement.</p>
        description: <p>The description of the prepared statement.</p>

    Raises:
        capo_athena.errors.internal_server_exception.InternalServerException: <p>Indicates a platform issue, which may be due to a transient condition or outage.</p>
        capo_athena.errors.invalid_request_exception.InvalidRequestException: <p>Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.</p>
        capo_athena.errors.resource_not_found_exception.ResourceNotFoundException: <p>A resource, such as a workgroup, was not found.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_athena.types.update_prepared_statement_input.UpdatePreparedStatementInput]",
    ) -> AsyncOperationResponse[
        "capo_athena.types.update_prepared_statement_output.UpdatePreparedStatementOutput"
    ]:
        import capo_athena._operations.amazon_athena.update_prepared_statement

        (
            output,
            http_response,
        ) = await capo_athena._operations.amazon_athena.update_prepared_statement.async_update_prepared_statement(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePreparedStatement")
    )
    input_: capo_athena.types.update_prepared_statement_input.UpdatePreparedStatementInput = {
        "statement_name": statement_name,
        "work_group": work_group,
        "query_statement": query_statement,
    }
    if description is not None:
        input_["description"] = description

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