Skip to content

get_table_metadata async

get_table_metadata(
    catalog_name: CatalogNameString,
    database_name: NameString,
    table_name: NameString,
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    work_group: Optional[WorkGroupName] = None,
) -> GetTableMetadataOutput

Returns table metadata for the specified catalog, database, and table.

Parameters:

  • catalog_name (CatalogNameString) –

    The name of the data catalog that contains the database and table metadata to return.

  • database_name (NameString) –

    The name of the database that contains the table metadata to return.

  • table_name (NameString) –

    The name of the table for which metadata is returned.

  • work_group (Optional[WorkGroupName], default: None ) –

    The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog.

Raises:

  • InternalServerException –

    Indicates a platform issue, which may be due to a transient condition or outage.

  • InvalidRequestException –

    Indicates that something is wrong with the input to the request. For example, a required parameter may be missing or out of range.

  • MetadataException –

    An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (InvalidRequestException) or from the Athena platform (InternalServerException). For example, if a user-created Lambda function is missing permissions, the Lambda 4XX exception is returned in a MetadataException.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_athena/_services/async_athena.py
async def get_table_metadata(
    self,
    catalog_name: "capo_athena.types.catalog_name_string.CatalogNameString",
    database_name: "capo_athena.types.name_string.NameString",
    table_name: "capo_athena.types.name_string.NameString",
    *,
    config_overrides: Optional[AsyncAthenaClientConfig] = None,
    work_group: Optional["capo_athena.types.work_group_name.WorkGroupName"] = None,
) -> "capo_athena.types.get_table_metadata_output.GetTableMetadataOutput":
    """<p>Returns table metadata for the specified catalog, database, and table.</p>

    Args:
        catalog_name: <p>The name of the data catalog that contains the database and table metadata to return.</p>
        database_name: <p>The name of the database that contains the table metadata to return.</p>
        table_name: <p>The name of the table for which metadata is returned.</p>
        work_group: <p>The name of the workgroup for which the metadata is being fetched. Required if requesting an IAM Identity Center enabled Glue Data Catalog.</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.metadata_exception.MetadataException: <p>An exception that Athena received when it called a custom metastore. Occurs if the error is not caused by user input (<code>InvalidRequestException</code>) or from the Athena platform (<code>InternalServerException</code>). For example, if a user-created Lambda function is missing permissions, the Lambda <code>4XX</code> exception is returned in a <code>MetadataException</code>.</p>
        capo_athena.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_athena.types.get_table_metadata_input.GetTableMetadataInput]",
    ) -> AsyncOperationResponse[
        "capo_athena.types.get_table_metadata_output.GetTableMetadataOutput"
    ]:
        import capo_athena._operations.amazon_athena.get_table_metadata

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetTableMetadata")
    )
    input_: capo_athena.types.get_table_metadata_input.GetTableMetadataInput = {
        "catalog_name": catalog_name,
        "database_name": database_name,
        "table_name": table_name,
    }
    if work_group is not None:
        input_["work_group"] = work_group

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