Examples#
Index > LakeFormation > Examples
Auto-generated documentation for LakeFormation type annotations stubs module types-aiobotocore-lakeformation.
Client#
Implicit type annotations#
Can be used with types-aiobotocore[lakeformation]
package installed.
Write your LakeFormation
code as usual,
type checking and code completion should work out of the box.
Client method usage example#
# LakeFormationClient usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("lakeformation") as client: # (1)
result = await client.add_lf_tags_to_resource() # (2)
- client: LakeFormationClient
- result: AddLFTagsToResourceResponseTypeDef
Paginator usage example#
# GetWorkUnitsPaginator usage example
from aiobotocore.session import get_session
session = get_session()
async with session.create_client("lakeformation") as client: # (1)
paginator = client.get_paginator("get_work_units") # (2)
async for item in paginator.paginate(...):
print(item) # (3)
- client: LakeFormationClient
- paginator: GetWorkUnitsPaginator
- item: GetWorkUnitsResponseTypeDef
Explicit type annotations#
With types-aiobotocore-lite[lakeformation]
or a standalone types_aiobotocore_lakeformation
package, you have to explicitly specify
client: LakeFormationClient
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#
# LakeFormationClient usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_lakeformation.client import LakeFormationClient
from types_aiobotocore_lakeformation.type_defs import AddLFTagsToResourceResponseTypeDef
from types_aiobotocore_lakeformation.type_defs import AddLFTagsToResourceRequestTypeDef
session = get_session()
async with session.create_client("lakeformation") as client:
client: LakeFormationClient
kwargs: AddLFTagsToResourceRequestTypeDef = {...}
result: AddLFTagsToResourceResponseTypeDef = await client.add_lf_tags_to_resource(**kwargs)
Paginator usage example#
# GetWorkUnitsPaginator usage example with type annotations
from aiobotocore.session import get_session
from types_aiobotocore_lakeformation.client import LakeFormationClient
from types_aiobotocore_lakeformation.paginator import GetWorkUnitsPaginator
from types_aiobotocore_lakeformation.type_defs import GetWorkUnitsResponseTypeDef
session = get_session()
async with session.create_client("lakeformation") as client:
client: LakeFormationClient
paginator: GetWorkUnitsPaginator = client.get_paginator("get_work_units")
async for item in paginator.paginate(...):
item: GetWorkUnitsResponseTypeDef
print(item)