Skip to content

Examples#

Index > GlueDataBrew > Examples

Auto-generated documentation for GlueDataBrew type annotations stubs module mypy-boto3-databrew.

Client#

Implicit type annotations#

Can be used with boto3-stubs[databrew] package installed.

Write your GlueDataBrew code as usual, type checking and code completion should work out of the box.

# GlueDataBrewClient usage example

from boto3.session import Session


session = Session()

client = session.client("databrew")  # (1)
result = client.batch_delete_recipe_version()  # (2)
  1. client: GlueDataBrewClient
  2. result: BatchDeleteRecipeVersionResponseTypeDef
# ListDatasetsPaginator usage example

from boto3.session import Session


session = Session()
client = session.client("databrew")  # (1)

paginator = client.get_paginator("list_datasets")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: GlueDataBrewClient
  2. paginator: ListDatasetsPaginator
  3. item: ListDatasetsResponsePaginatorTypeDef

Explicit type annotations#

With boto3-stubs-lite[databrew] or a standalone mypy_boto3_databrew package, you have to explicitly specify client: GlueDataBrewClient 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.

# GlueDataBrewClient usage example with type annotations

from boto3.session import Session

from mypy_boto3_databrew.client import GlueDataBrewClient
from mypy_boto3_databrew.type_defs import BatchDeleteRecipeVersionResponseTypeDef
from mypy_boto3_databrew.type_defs import BatchDeleteRecipeVersionRequestRequestTypeDef


session = Session()

client: GlueDataBrewClient = session.client("databrew")

kwargs: BatchDeleteRecipeVersionRequestRequestTypeDef = {...}
result: BatchDeleteRecipeVersionResponseTypeDef = client.batch_delete_recipe_version(**kwargs)
# ListDatasetsPaginator usage example with type annotations

from boto3.session import Session

from mypy_boto3_databrew.client import GlueDataBrewClient
from mypy_boto3_databrew.paginator import ListDatasetsPaginator
from mypy_boto3_databrew.type_defs import ListDatasetsResponsePaginatorTypeDef


session = Session()
client: GlueDataBrewClient = session.client("databrew")

paginator: ListDatasetsPaginator = client.get_paginator("list_datasets")
for item in paginator.paginate(...):
    item: ListDatasetsResponsePaginatorTypeDef
    print(item)