{"id":3070,"library":"mypy-boto3-dax","title":"mypy-boto3-dax Type Annotations","description":"mypy-boto3-dax provides type annotations for the AWS DynamoDB Accelerator (DAX) service, compatible with `boto3`. It enhances development with static type checking, autocomplete, and improved IDE support for `boto3` DAX clients. This package is version `1.42.3`, generated by `mypy-boto3-builder` `8.12.0`, which periodically releases updates to align with new `boto3` versions and address type-related issues.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","typing","mypy","dax","stubs","type-annotations","autocomplete"],"install":[{"cmd":"pip install mypy-boto3-dax boto3","lang":"bash","label":"Install with boto3"}],"dependencies":[{"reason":"Provides the AWS SDK for Python; mypy-boto3-dax provides type stubs for it.","package":"boto3","optional":false},{"reason":"Requires Python 3.9 or higher.","package":"python","optional":false}],"imports":[{"note":"Import the typed client for DAX service.","symbol":"DAXClient","correct":"from mypy_boto3_dax.client import DAXClient"},{"note":"Import specific TypedDicts for response shapes.","symbol":"DescribeClustersResponseTypeDef","correct":"from mypy_boto3_dax.type_defs import DescribeClustersResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_dax.client import DAXClient\nfrom mypy_boto3_dax.type_defs import DescribeClustersResponseTypeDef\n\ndef get_dax_clusters() -> DescribeClustersResponseTypeDef:\n    # boto3.client is implicitly typed by mypy-boto3-dax if installed\n    # For explicit typing, use:\n    client: DAXClient = boto3.client('dax')\n    response: DescribeClustersResponseTypeDef = client.describe_clusters(\n        MaxResults=5\n    )\n    return response\n\nif __name__ == '__main__':\n    # Ensure AWS credentials are configured (e.g., via environment variables or ~/.aws/credentials)\n    try:\n        clusters_info = get_dax_clusters()\n        print(f\"Found {len(clusters_info['Clusters'])} DAX clusters.\")\n        for cluster in clusters_info['Clusters']:\n            print(f\"  - Cluster Name: {cluster['ClusterName']}, Status: {cluster['Status']}\")\n    except Exception as e:\n        print(f\"Error fetching DAX clusters: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` DAX client and use its methods with type annotations provided by `mypy-boto3-dax`. Explicit type hints for the client and response are shown for clarity, though modern IDEs and `mypy` can often infer these implicitly with `mypy-boto3-dax` installed."},"warnings":[{"fix":"Upgrade Python to 3.9 or newer.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0. Users on Python 3.8 must upgrade their Python version to 3.9 or higher to use the latest `mypy-boto3-dax` stubs.","severity":"breaking","affected_versions":">=8.12.0 (builder)"},{"message":"Type definition naming conventions changed in `mypy-boto3-builder` 8.9.0, leading to shorter names for packed method arguments (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This may require updates to explicit type hints in existing code.","severity":"breaking"},{"message":"`mypy-boto3-dax` provides only type annotations; `boto3` itself must be installed and correctly configured with AWS credentials for the code to run at runtime.","severity":"gotcha"},{"message":"While often implicitly handled by IDEs, explicit type annotations (e.g., `client: DAXClient = boto3.client('dax')`) are recommended for optimal code completion and static analysis, especially when using `mypy-boto3-lite` or older IDE versions.","severity":"gotcha"},{"message":"PyCharm users might experience performance issues due to its handling of `Literal` overloads. Using `types-boto3-lite` (if available for DAX) or being mindful of explicit typing can mitigate this.","severity":"gotcha"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}