[Python] Error fetching data catalog from AWS Athena through boto3 in python:...

Discussão em 'Python' iniciado por Stack, Junho 10, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to work with AWS' client API in python using boto3. I've been trying get_data_catalog() but it throws an error:

    File ".../.venv/lib/python3.13/site-packages/botocore/client.py", line 598, in _api_call
    return self._make_api_call(operation_name, kwargs)
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
    File ".../.venv/lib/python3.13/site-packages/botocore/context.py", line 123, in wrapper
    return func(*args, **kwargs)
    File ".../.venv/lib/python3.13/site-packages/botocore/client.py", line 1061, in _make_api_call
    raise error_class(parsed_response, operation_name)
    botocore.errorfactory.InvalidRequestException: An error occurred (InvalidRequestException) when calling the GetDataCatalog operation: DataCatalog AwsDataCatalog was not found.


    On Athena, AwsDataCatalog is listed as a Data Source. But when I use list_data_catalogs(), I get:

    {
    "DataCatalogsSummary": [
    {
    "CatalogName": "AwsDataCatalog",
    "Type": "GLUE",
    "Status": "CREATE_COMPLETE"
    }
    ],
    "ResponseMetadata": {
    "HTTPStatusCode": 200,
    ...
    }
    }


    And this throws an error too:

    response = self.connection.list_data_catalogs()
    catalog = self.connection.get_data_catalog(
    Name=response["DataCatalogsSummary"][0]["CatalogName"]
    )
    print(response)


    What am I missing?

    Continue reading...

Compartilhe esta Página