Skip to content

Examples#

Index > RedshiftDataAPIService > Examples

Auto-generated documentation for RedshiftDataAPIService type annotations stubs module types-boto3-redshift-data.

Client#

Implicit type annotations#

Can be used with types-boto3[redshift-data] package installed.

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

# RedshiftDataAPIServiceClient usage example

from boto3.session import Session


session = Session()

client = session.client("redshift-data")  # (1)
result = client.batch_execute_statement()  # (2)
  1. client: RedshiftDataAPIServiceClient
  2. result: BatchExecuteStatementOutputTypeDef
# DescribeTablePaginator usage example

from boto3.session import Session


session = Session()
client = session.client("redshift-data")  # (1)

paginator = client.get_paginator("describe_table")  # (2)
for item in paginator.paginate(...):
    print(item)  # (3)
  1. client: RedshiftDataAPIServiceClient
  2. paginator: DescribeTablePaginator
  3. item: DescribeTableResponseTypeDef

Explicit type annotations#

With types-boto3-lite[redshift-data] or a standalone types_boto3_redshift_data package, you have to explicitly specify client: RedshiftDataAPIServiceClient 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.

# RedshiftDataAPIServiceClient usage example with type annotations

from boto3.session import Session

from types_boto3_redshift_data.client import RedshiftDataAPIServiceClient
from types_boto3_redshift_data.type_defs import BatchExecuteStatementOutputTypeDef
from types_boto3_redshift_data.type_defs import BatchExecuteStatementInputRequestTypeDef


session = Session()

client: RedshiftDataAPIServiceClient = session.client("redshift-data")

kwargs: BatchExecuteStatementInputRequestTypeDef = {...}
result: BatchExecuteStatementOutputTypeDef = client.batch_execute_statement(**kwargs)
# DescribeTablePaginator usage example with type annotations

from boto3.session import Session

from types_boto3_redshift_data.client import RedshiftDataAPIServiceClient
from types_boto3_redshift_data.paginator import DescribeTablePaginator
from types_boto3_redshift_data.type_defs import DescribeTableResponseTypeDef


session = Session()
client: RedshiftDataAPIServiceClient = session.client("redshift-data")

paginator: DescribeTablePaginator = client.get_paginator("describe_table")
for item in paginator.paginate(...):
    item: DescribeTableResponseTypeDef
    print(item)