Type Annotations for Boto3 Bedrock Data Automation
This library provides type annotations for the `boto3` AWS SDK, specifically for the Bedrock Data Automation service. It enables static type checking tools like `mypy` to validate interactions with the service, improving code quality and catching potential errors at development time. It is generated by the `mypy-boto3-builder` project and is frequently updated to align with `boto3` and AWS API changes. The current version is 1.42.82.
Warnings
- breaking Starting with `mypy-boto3-builder` version 8.12.0 (which generated `mypy-boto3-bedrock-data-automation` 1.42.82+), support for Python 3.8 has been removed. All generated stub packages now require Python 3.9 or newer.
- breaking The `mypy-boto3` family of packages, including this one, migrated to PEP 561 compliant packaging in builder version 8.12.0. While generally beneficial for stub discovery, this might affect custom tooling or build processes that relied on previous, non-standard stub packaging methods.
- gotcha This package provides only type annotations. You must install `boto3` separately (`pip install boto3`) for the actual AWS SDK functionality at runtime. For optimal type checking, ensure your `mypy-boto3-bedrock-data-automation` version aligns with your `boto3` version (e.g., `boto3==1.28.x` with `mypy-boto3-bedrock-data-automation==1.28.x`).
- breaking Type definition names were shortened and conflicting names resolved in `mypy-boto3-builder` 8.9.0. If you explicitly imported `TypeDef` classes from older versions, their names might have changed (e.g., `CreateDistributionRequestRequestTypeDef` might become `CreateDistributionRequestTypeDef`).
Install
-
pip install mypy-boto3-bedrock-data-automation boto3
Imports
- BedrockDataAutomationClient
from mypy_boto3_bedrock_data_automation.client import BedrockDataAutomationClient
- ListDataAutomationJobsRequestRequestTypeDef
from mypy_boto3_bedrock_data_automation.type_defs import ListDataAutomationJobsRequestRequestTypeDef
- DataAutomationJobSummaryTypeDef
from mypy_boto3_bedrock_data_automation.type_defs import DataAutomationJobSummaryTypeDef
Quickstart
import boto3
from mypy_boto3_bedrock_data_automation.client import BedrockDataAutomationClient
from mypy_boto3_bedrock_data_automation.type_defs import ListDataAutomationJobsRequestRequestTypeDef
from typing import TYPE_CHECKING
import os
# Ensure boto3 is configured, e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION_NAME env vars
# Or configure a session explicitly: boto3.Session(region_name="us-east-1")
if TYPE_CHECKING:
client: BedrockDataAutomationClient = boto3.client("bedrock-data-automation")
else:
client = boto3.client("bedrock-data-automation")
# Example: List data automation jobs
try:
print("Listing Bedrock Data Automation jobs...")
response = client.list_data_automation_jobs()
jobs = response.get("dataAutomationJobs", [])
if jobs:
print(f"Found {len(jobs)} jobs:")
for job in jobs:
print(f" Job ID: {job.get('jobId')}, Status: {job.get('status')}, Created: {job.get('creationTime')}")
else:
print("No Bedrock Data Automation jobs found.")
except client.exceptions.ServiceException as e:
print(f"AWS Service Error: {e.response['Error']['Code']} - {e.response['Error']['Message']}")
except Exception as e:
print(f"An unexpected error occurred: {e}")