{"id":3085,"library":"mypy-boto3-emr-containers","title":"Type Annotations for boto3 EMR Containers","description":"mypy-boto3-emr-containers provides static type annotations (stubs) for the boto3 EMR Containers service, enhancing development with type-checking capabilities. It ensures type safety when using boto3 clients, resources, and collections for EMR Containers, preventing common runtime errors. The library is automatically generated by mypy-boto3-builder and typically releases new versions in sync with boto3 and botocore updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["boto3","aws","mypy","type-hints","stubs","emr-containers","type-checking"],"install":[{"cmd":"pip install mypy-boto3-emr-containers boto3","lang":"bash","label":"Install with boto3"},{"cmd":"pip install mypy-boto3-emr-containers","lang":"bash","label":"Install stubs only (boto3 separate)"}],"dependencies":[{"reason":"Provides the actual AWS SDK runtime; these stubs provide type hints for it.","package":"boto3","optional":false},{"reason":"Core botocore stubs for EMR Containers, automatically installed as a dependency.","package":"types-botocore-emr-containers","optional":false},{"reason":"Required for static type checking; not a runtime dependency.","package":"mypy","optional":true}],"imports":[{"note":"The client type is provided by the stub package, not directly from boto3.","wrong":"from boto3.client import EMRContainersClient","symbol":"EMRContainersClient","correct":"from mypy_boto3_emr_containers import EMRContainersClient"},{"note":"Type definitions (TypedDicts) are located in the `type_defs` submodule.","wrong":"from mypy_boto3_emr_containers.client import ListVirtualClustersOutputTypeDef","symbol":"ListVirtualClustersOutputTypeDef","correct":"from mypy_boto3_emr_containers.type_defs import ListVirtualClustersOutputTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_emr_containers import EMRContainersClient\nfrom mypy_boto3_emr_containers.type_defs import ListVirtualClustersOutputTypeDef\n\ndef get_emr_containers_client() -> EMRContainersClient:\n    \"\"\"Returns a type-hinted EMR Containers client.\"\"\"\n    # Ensure boto3 is installed: pip install boto3 mypy-boto3-emr-containers\n    client: EMRContainersClient = boto3.client(\"emr-containers\")\n    return client\n\ndef list_virtual_clusters() -> None:\n    \"\"\"Lists EMR Containers virtual clusters with type checking.\"\"\"\n    client = get_emr_containers_client()\n    try:\n        response: ListVirtualClustersOutputTypeDef = client.list_virtual_clusters()\n        print(\"Successfully listed virtual clusters:\")\n        for cluster in response.get(\"virtualClusters\", []):\n            name = cluster.get(\"name\", \"N/A\")\n            cluster_id = cluster.get(\"id\", \"N/A\")\n            status = cluster.get(\"status\", {}).get(\"state\", \"UNKNOWN\")\n            print(f\"  - Name: {name}, ID: {cluster_id}, Status: {status}\")\n        if not response.get(\"virtualClusters\"):\n            print(\"  No virtual clusters found.\")\n    except Exception as e:\n        print(f\"Error listing virtual clusters: {e}\")\n\nif __name__ == \"__main__\":\n    list_virtual_clusters()\n","lang":"python","description":"This quickstart demonstrates how to instantiate a type-hinted EMR Containers client and use it to list virtual clusters. The `EMRContainersClient` type ensures that method calls and return values are correctly type-checked by tools like mypy, catching potential issues at development time rather than runtime. Remember to have `boto3` installed alongside the stubs."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher. If you must use Python 3.8, pin your mypy-boto3-emr-containers version to an earlier release (e.g., <1.42.0).","message":"Python 3.8 support was removed for all mypy-boto3 packages, including mypy-boto3-emr-containers, starting with mypy-boto3-builder v8.12.0.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (generating mypy-boto3-emr-containers >= 1.42.x)"},{"fix":"Always install `boto3` alongside `mypy-boto3-emr-containers` (e.g., `pip install boto3 mypy-boto3-emr-containers`).","message":"This package provides *type stubs* for boto3, not boto3 itself. You must install `boto3` separately for your code to run.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Update your type annotation imports and usage to reflect the new TypeDef names. Consult the generated stub files or the `mypy-boto3-builder` release notes for specific changes.","message":"TypeDef naming conventions changed significantly with mypy-boto3-builder v8.9.0. Some TypeDefs for packed method arguments or conflicting names received shorter or reordered postfixes (e.g., `CreateDistributionRequestRequestTypeDef` -> `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (generating mypy-boto3-emr-containers versions from this builder version onwards)"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}