mypy-boto3-emr-serverless Type Stubs
mypy-boto3-emr-serverless provides type annotations (stubs) for the boto3 EMRServerless client, enabling static type checking with tools like MyPy. It ensures type safety and autocompletion for EMR Serverless operations when using boto3. The package is generated by `mypy-boto3-builder` and is updated frequently, often in sync with boto3/botocore releases.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-emr-serverless` 1.42.23+), support for Python 3.8 has been removed. Projects using these stubs must target Python 3.9 or newer.
- breaking All `mypy-boto3` packages, including `mypy-boto3-emr-serverless`, migrated to PEP 561 distribution format with `mypy-boto3-builder` version 8.12.0. While typically seamless, this might affect how certain tooling or custom environments discover type stubs.
- gotcha `mypy-boto3-emr-serverless` provides only type stubs for static analysis. It should *not* be imported or used at runtime. The actual EMR Serverless client functionality comes from `boto3`.
- gotcha From `mypy-boto3-builder` version 8.9.0, some TypeDef names were changed for consistency (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). While not specific to EMR Serverless, this pattern might lead to breaking changes in type references for other services or if future EMR Serverless TypeDefs follow a similar pattern.
Install
-
pip install mypy-boto3-emr-serverless boto3
Imports
- EMRServerlessClient
from mypy_boto3_emr_serverless.client import EMRServerlessClient
- ListApplicationsPaginator
from mypy_boto3_emr_serverless.paginator import ListApplicationsPaginator
- ApplicationStateTypeDef
from mypy_boto3_emr_serverless.type_defs import ApplicationStateTypeDef
Quickstart
import boto3
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from mypy_boto3_emr_serverless.client import EMRServerlessClient
from mypy_boto3_emr_serverless.type_defs import ListApplicationsOutputTypeDef
def get_emr_serverless_applications() -> None:
client: EMRServerlessClient = boto3.client("emr-serverless")
response: ListApplicationsOutputTypeDef = client.list_applications()
print(f"Found {len(response['applications'])} EMR Serverless applications.")
for app in response.get('applications', []):
print(f"- {app['name']} (State: {app['state']})")
if __name__ == "__main__":
get_emr_serverless_applications()