Install & Compatibility
Where this runs
tested against v1.43.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.5MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.7s · import 0.000s · 19MB
71MB installed
● package 71MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AthenaClient
✓ from mypy_boto3_athena import AthenaClient
✗ from mypy_boto3_athena import AthenaClient
This quickstart demonstrates how to initialize an Athena client with type annotations from `mypy-boto3-athena` and define input parameters using TypeDefs, enabling static type checking for your boto3 calls. It assumes `boto3` is already installed and configured with AWS credentials.
import boto3
from mypy_boto3_athena.client import AthenaClient
from mypy_boto3_athena.type_defs import StartQueryExecutionInputRequestTypeDef
import os
# Instantiate a boto3 Athena client with type annotations
def get_athena_client() -> AthenaClient:
return boto3.client("athena", region_name=os.environ.get('AWS_REGION', 'us-east-1'))
client: AthenaClient = get_athena_client()
# Define input using a TypeDef for static checking
query_execution_input: StartQueryExecutionInputRequestTypeDef = {
"QueryString": "SELECT 1 FROM \"AwsDataCatalog\".\"default\".\"test_table\" LIMIT 1;",
"WorkGroup": os.environ.get('ATHENA_WORKGROUP', 'primary'),
"ResultConfiguration": {
"OutputLocation": os.environ.get('ATHENA_OUTPUT_LOCATION', 's3://your-athena-results-bucket/'),
},
}
print(f"Client type: {type(client)}")
print("Type checking for Athena operations is now enabled.")
# Example of a type-checked call (uncomment to run, requires valid AWS setup)
# try:
# response = client.start_query_execution(**query_execution_input)
# print(f"Query Execution ID: {response['QueryExecutionId']}")
# except Exception as e:
# print(f"Error starting query (ensure AWS_REGION, ATHENA_WORKGROUP, ATHENA_OUTPUT_LOCATION are set and valid): {e}")
Debug
Known issues
breakingPython 3.8 support has been removed since `mypy-boto3-builder` version 8.12.0. All `mypy-boto3` packages built with this builder or later will require Python 3.9 or higher.fixUpgrade your Python environment to 3.9 or newer.
affects: mypy-boto3-builder >= 8.12.0 (and dependent mypy-boto3-* packages)
breakingMigration to PEP 561 packages in `mypy-boto3-builder` version 8.12.0 changes the internal structure and how type checkers locate stubs. While user-facing imports are generally stable, some tooling or custom MyPy configurations might require adjustments.fixEnsure your MyPy version is up-to-date and that your environment correctly resolves PEP 561-compliant stub packages. For most users, this change is transparent.
affects: mypy-boto3-builder >= 8.12.0 (and dependent mypy-boto3-* packages)
gotchaThis package provides only type stubs, not the functional `boto3` library itself. You must explicitly install `boto3` (e.g., `pip install boto3`) for your code to run.fixAlways install `boto3` alongside `mypy-boto3-athena`.
affects: All versions
breakingIn `mypy-boto3-builder` version 8.9.0, TypeDef naming conventions were updated. This included shortening duplicated 'Request' suffixes (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving 'Extra' postfixes. If you directly imported specific TypeDefs, their names might have changed.fixConsult the `mypy-boto3` documentation or regenerate your code's type hints to reflect the new TypeDef names. Your IDE's autocomplete can often help identify the correct names.
affects: mypy-boto3-builder >= 8.9.0 (and dependent mypy-boto3-* packages)
Upgrade
Version history
1.43.0latest on PyPI · released Apr 29, 2026
Audit
Dependencies
boto3requiredThis package provides type stubs for boto3's Athena client. The actual boto3 library must be installed separately to run the code.