mypy-boto3-finspace-data Type Annotations
This package provides type annotations for the `boto3` FinSpaceData service, generated with `mypy-boto3-builder`. It ensures type checking for your AWS FinSpaceData client code. The current version is 1.42.3, and releases are frequent, typically in sync with new `boto3` and `botocore` versions, or when new AWS service features are released.
Warnings
- breaking Support for Python 3.8 was removed in version 8.12.0 of the `mypy-boto3-builder`, which affects all generated service packages, including `mypy-boto3-finspace-data`. Projects using Python 3.8 will need to upgrade to Python 3.9+.
- breaking Version 8.9.0 of the builder introduced changes to how `TypedDict` names are generated for certain API parameters and responses (e.g., shortening `CreateDistributionRequestRequestTypeDef` to `CreateDistributionRequestTypeDef`). This can cause type checking errors if your code relies on the old, longer `TypedDict` names.
- gotcha This package provides only type stubs (interface definitions) for `boto3`. It does not contain any runtime code. You must install `boto3` (and its dependencies like `botocore`) separately for your code to execute.
- gotcha For optimal type checking, the major and minor version of `mypy-boto3-finspace-data` should ideally match your installed `boto3` version. Mismatched versions can lead to incorrect or missing type definitions, especially with new API features or changes.
Install
-
pip install mypy-boto3-finspace-data
Imports
- FinSpaceDataClient
from mypy_boto3_finspace_data.client import FinSpaceDataClient
- ListChangesetsResponseTypeDef
from mypy_boto3_finspace_data.type_defs import ListChangesetsResponseTypeDef
Quickstart
from typing import TYPE_CHECKING
import boto3
if TYPE_CHECKING:
from mypy_boto3_finspace_data.client import FinSpaceDataClient
from mypy_boto3_finspace_data.type_defs import ListChangesetsResponseTypeDef
try:
# Initialize the boto3 client for FinSpaceData
client: FinSpaceDataClient = boto3.client('finspace-data')
# Example API call: ListChangesets
# Note: Replace 'your-dataset-id' with an actual FinSpaceData dataset ID
# or use a placeholder for type checking demonstration.
dataset_id = 'your-dataset-id' # os.environ.get('FINSPACE_DATA_DATASET_ID', 'placeholder')
if dataset_id == 'your-dataset-id':
print("Please provide a valid FinSpaceData dataset ID for a successful API call.")
# For demonstration, we'll simulate a response structure for type checking.
response: ListChangesetsResponseTypeDef = {
'changesets': [],
'nextToken': 'string',
'ResponseMetadata': {
'RequestId': 'string',
'HTTPStatusCode': 200,
'HTTPHeaders': {},
'RetryAttempts': 0
}
}
else:
response = client.list_changesets(datasetId=dataset_id)
print(f"Successfully listed changesets for dataset '{dataset_id}'.")
print(f"First changeset ID: {response['changesets'][0]['changesetId'] if response['changesets'] else 'N/A'}")
# Type check the response structure
_ = response['changesets']
_ = response['ResponseMetadata']
except Exception as e:
print(f"An error occurred: {e}")