Examples#
Index > EMRContainers > Examples
Auto-generated documentation for EMRContainers type annotations stubs module mypy-boto3-emr-containers.
Client#
Implicit type annotations#
Can be used with boto3-stubs[emr-containers]
package installed.
Write your EMRContainers
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# EMRContainersClient usage example
from boto3.session import Session
session = Session()
client = session.client("emr-containers") # (1)
result = client.cancel_job_run() # (2)
- client: EMRContainersClient
- result: CancelJobRunResponseTypeDef
Paginator usage example#
# ListJobRunsPaginator usage example
from boto3.session import Session
session = Session()
client = session.client("emr-containers") # (1)
paginator = client.get_paginator("list_job_runs") # (2)
for item in paginator.paginate(...):
print(item) # (3)
- client: EMRContainersClient
- paginator: ListJobRunsPaginator
- item: ListJobRunsResponseTypeDef
Explicit type annotations#
With boto3-stubs-lite[emr-containers]
or a standalone mypy_boto3_emr_containers
package, you have to explicitly specify client: EMRContainersClient
type annotation.
All other type annotations are optional, as types should be discovered automatically. However, these type annotations can be helpful in your functions and methods.
Client method usage example#
# EMRContainersClient usage example with type annotations
from boto3.session import Session
from mypy_boto3_emr_containers.client import EMRContainersClient
from mypy_boto3_emr_containers.type_defs import CancelJobRunResponseTypeDef
from mypy_boto3_emr_containers.type_defs import CancelJobRunRequestTypeDef
session = Session()
client: EMRContainersClient = session.client("emr-containers")
kwargs: CancelJobRunRequestTypeDef = {...}
result: CancelJobRunResponseTypeDef = client.cancel_job_run(**kwargs)
Paginator usage example#
# ListJobRunsPaginator usage example with type annotations
from boto3.session import Session
from mypy_boto3_emr_containers.client import EMRContainersClient
from mypy_boto3_emr_containers.paginator import ListJobRunsPaginator
from mypy_boto3_emr_containers.type_defs import ListJobRunsResponseTypeDef
session = Session()
client: EMRContainersClient = session.client("emr-containers")
paginator: ListJobRunsPaginator = client.get_paginator("list_job_runs")
for item in paginator.paginate(...):
item: ListJobRunsResponseTypeDef
print(item)