{"id":7815,"library":"types-aiobotocore-athena","title":"Type Annotations for aiobotocore Athena","description":"This library provides comprehensive static type annotations for the `aiobotocore` AWS Athena service client. Generated by `mypy-boto3-builder`, it enhances code reliability and developer experience by enabling static type checking with tools like MyPy, offering features such as autocompletion and early error detection. It is currently at version 3.4.0, generated with `mypy-boto3-builder 8.12.0`, and receives frequent updates in sync with new `aiobotocore` releases and builder improvements. Python 3.9+ is required.","status":"active","version":"3.4.0","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["type-stubs","async","aws","athena","aiobotocore","mypy"],"install":[{"cmd":"pip install types-aiobotocore-athena aiobotocore","lang":"bash","label":"Install with aiobotocore"}],"dependencies":[{"reason":"Provides the actual asynchronous AWS SDK functionality; this package only offers type stubs for it.","package":"aiobotocore","optional":false},{"reason":"Static type checker to leverage the provided annotations during development.","package":"mypy","optional":true}],"imports":[{"symbol":"AthenaClient","correct":"from types_aiobotocore_athena.client import AthenaClient"},{"note":"Type definitions are located in the `type_defs` module, not `client`.","wrong":"from types_aiobotocore_athena.client import BatchGetNamedQueryOutputTypeDef","symbol":"BatchGetNamedQueryOutputTypeDef","correct":"from types_aiobotocore_athena.type_defs import BatchGetNamedQueryOutputTypeDef"},{"note":"Literal types (string enums) are typically found in the `literals` module.","wrong":"from types_aiobotocore_athena.type_defs import AuthenticationTypeType","symbol":"AuthenticationTypeType","correct":"from types_aiobotocore_athena.literals import AuthenticationTypeType"}],"quickstart":{"code":"import asyncio\nimport os\nfrom aiobotocore.session import get_session\nfrom types_aiobotocore_athena.client import AthenaClient\nfrom types_aiobotocore_athena.type_defs import StartQueryExecutionOutputTypeDef\n\n\nasync def list_athena_workgroups() -> None:\n    session = get_session()\n    # For demonstration, using dummy credentials. Replace with actual config or env vars.\n    aws_access_key_id = os.environ.get('AWS_ACCESS_KEY_ID', 'testing')\n    aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY', 'testing')\n    aws_session_token = os.environ.get('AWS_SESSION_TOKEN', 'testing')\n\n    async with session.create_client(\n        \"athena\",\n        region_name=\"us-east-1\",\n        aws_access_key_id=aws_access_key_id,\n        aws_secret_access_key=aws_secret_access_key,\n        aws_session_token=aws_session_token\n    ) as client:\n        client: AthenaClient # Explicit type annotation is optional but recommended\n        try:\n            response = await client.list_work_groups()\n            print(\"Athena Workgroups:\")\n            for wg in response.get('WorkGroups', []):\n                print(f\"  - {wg.get('Name')} (State: {wg.get('State')})\")\n        except client.exceptions.ClientError as e:\n            print(f\"Error listing workgroups: {e}\")\n\nasync def run_example():\n    await list_athena_workgroups()\n\nif __name__ == \"__main__\":\n    asyncio.run(run_example())\n","lang":"python","description":"This example demonstrates how to use `types-aiobotocore-athena` with `aiobotocore` to list Athena workgroups. It includes explicit type annotations for the client, allowing IDEs and static analyzers like MyPy to provide intelligent autocompletion and type checking for Athena client methods and their return types. Remember to set up actual AWS credentials for real-world usage."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Python 3.8 support was removed from `mypy-boto3-builder` (which generates these stubs) in version 8.12.0. Users on Python 3.8 or older will need to upgrade their Python version to `>=3.9` or use an older stub version.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Update `TypeDef` import names in your code to match the new conventions. Consult the specific service's `type_defs.pyi` for the correct names.","message":"Type definition (TypeDef) naming conventions changed in `mypy-boto3-builder` 8.9.0. This includes shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`) and moving the `Extra` postfix. Code explicitly importing and using these `TypeDefs` may break.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Ensure both `aiobotocore` (runtime) and `mypy` (dev) are installed alongside `types-aiobotocore-athena`.","message":"This package (`types-aiobotocore-athena`) provides *only* type annotations. You must install `aiobotocore` separately for the actual asynchronous AWS SDK functionality at runtime. For static type checking, `mypy` is also required as a development dependency.","severity":"gotcha","affected_versions":"All"},{"fix":"Ensure your type checker (e.g., MyPy) is up-to-date and correctly configured to find PEP 561-style stub packages. Most common setups should work without manual intervention.","message":"The `mypy-boto3` ecosystem migrated to PEP 561-compliant packages in `mypy-boto3-builder` 8.12.0. While this generally improves compatibility, some tools or custom configurations that relied on older stub discovery mechanisms might require adjustments.","severity":"gotcha","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Refer to official AWS `aiobotocore` documentation for service names and changes. If a service is renamed, update your `session.create_client()` calls and corresponding `types-aiobotocore-*` stub imports.","message":"Occasionally, specific AWS services may be renamed or deprecated within the `aiobotocore` ecosystem (e.g., `sms-voice` was replaced by `pinpoint-sms-voice` in `mypy-boto3-builder` 8.11.0). While this specific stub is for Athena, keep an eye on upstream `aiobotocore` changes, as they might eventually affect the service name or availability.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Install the `aiobotocore` library: `pip install aiobotocore`.","cause":"The `types-aiobotocore-athena` package only provides type hints; the actual `aiobotocore` library is not installed.","error":"ModuleNotFoundError: No module named 'aiobotocore'"},{"fix":"Ensure `types-aiobotocore-athena` is installed and that MyPy is configured to check your environment. Sometimes explicitly installing `types-aiobotocore` (the umbrella package) can help, or if using `aiobotocore` as a dependency in `pyproject.toml`, ensure it's in a section MyPy checks.","cause":"Mypy cannot find type information for `aiobotocore` because the stub package for Athena is installed, but the core `aiobotocore` stubs or the specific service stubs are not being correctly picked up, or the stub package itself is missing.","error":"error: Library stubs not installed for \"aiobotocore.session\" [no-any-unimported]"},{"fix":"Check the `aiobotocore` documentation for the correct method name and available APIs for your installed version. Ensure your `aiobotocore` installation is up-to-date: `pip install --upgrade aiobotocore`.","cause":"The code is attempting to call a method on the Athena client that does not exist in the installed `aiobotocore` version or is a typo. The type stubs reflect the latest `aiobotocore` API, which might differ from an older runtime version.","error":"AttributeError: 'AthenaClient' object has no attribute 'non_existent_method'"}]}