Skip to content

update_partition async

update_partition(
    database_name: NameString,
    table_name: NameString,
    partition_value_list: BoundedPartitionValueList,
    partition_input: PartitionInput,
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[CatalogIdString] = None,
) -> UpdatePartitionResponse

Updates a partition.

Parameters:

  • catalog_id (Optional[CatalogIdString], default: None ) –

    The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.

  • database_name (NameString) –

    The name of the catalog database in which the table in question resides.

  • table_name (NameString) –

    The name of the table in which the partition to be updated is located.

  • partition_value_list (BoundedPartitionValueList) –

    List of partition key values that define the partition to update.

  • partition_input (PartitionInput) –

    The new partition object to update the partition to.

    The Values property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.

Raises:

Source code in docs_src/capo_glue/_services/async_glue.py
async def update_partition(
    self,
    database_name: "capo_glue.types.name_string.NameString",
    table_name: "capo_glue.types.name_string.NameString",
    partition_value_list: "capo_glue.types.bounded_partition_value_list.BoundedPartitionValueList",
    partition_input: "capo_glue.types.partition_input.PartitionInput",
    *,
    config_overrides: Optional[AsyncGlueClientConfig] = None,
    catalog_id: Optional[
        "capo_glue.types.catalog_id_string.CatalogIdString"
    ] = None,
) -> "capo_glue.types.update_partition_response.UpdatePartitionResponse":
    """<p>Updates a partition.</p>

    Args:
        catalog_id: <p>The ID of the Data Catalog where the partition to be updated resides. If none is provided, the Amazon Web Services account ID is used by default.</p>
        database_name: <p>The name of the catalog database in which the table in question resides.</p>
        table_name: <p>The name of the table in which the partition to be updated is located.</p>
        partition_value_list: <p>List of partition key values that define the partition to update.</p>
        partition_input: <p>The new partition object to update the partition to.</p> <p>The <code>Values</code> property can't be changed. If you want to change the partition key values for a partition, delete and recreate the partition.</p>

    Raises:
        capo_glue.errors.entity_not_found_exception.EntityNotFoundException: <p>A specified entity does not exist</p>
        capo_glue.errors.glue_encryption_exception.GlueEncryptionException: <p>An encryption operation failed.</p>
        capo_glue.errors.internal_service_exception.InternalServiceException: <p>An internal service error occurred.</p>
        capo_glue.errors.invalid_input_exception.InvalidInputException: <p>The input provided was not valid.</p>
        capo_glue.errors.operation_timeout_exception.OperationTimeoutException: <p>The operation timed out.</p>
        capo_glue.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_glue.types.update_partition_request.UpdatePartitionRequest]",
    ) -> AsyncOperationResponse[
        "capo_glue.types.update_partition_response.UpdatePartitionResponse"
    ]:
        import capo_glue._operations.aws_glue.update_partition

        (
            output,
            http_response,
        ) = await capo_glue._operations.aws_glue.update_partition.async_update_partition(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("UpdatePartition")
    )
    input_: capo_glue.types.update_partition_request.UpdatePartitionRequest = {
        "database_name": database_name,
        "table_name": table_name,
        "partition_value_list": partition_value_list,
        "partition_input": partition_input,
    }
    if catalog_id is not None:
        input_["catalog_id"] = catalog_id

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