{"id":3126,"library":"mypy-boto3-rds-data","title":"mypy-boto3-rds-data Type Annotations","description":"mypy-boto3-rds-data provides comprehensive type annotations for the boto3 RDSDataService, enhancing static analysis, autocompletion, and type checking for AWS RDS Data API interactions in Python. This library, currently at version 1.42.3, is generated by the mypy-boto3-builder and offers compatibility with popular IDEs like VSCode and PyCharm, as well as type checkers such as Mypy and Pyright. New versions are released in sync with boto3 updates.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["mypy","boto3","aws","typing","stubs","rds-data","type-hints","static-analysis"],"install":[{"cmd":"pip install mypy-boto3-rds-data boto3 mypy","lang":"bash","label":"Install library, boto3, and mypy"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality.","package":"boto3","optional":false},{"reason":"Type checker for static analysis.","package":"mypy","optional":true},{"reason":"Requires Python 3.9 or higher.","package":"python","optional":false}],"imports":[{"symbol":"RDSDataServiceClient","correct":"from mypy_boto3_rds_data.client import RDSDataServiceClient"},{"note":"Type definitions for method input/output parameters.","symbol":"ArrayValueOutputTypeDef","correct":"from mypy_boto3_rds_data.type_defs import ArrayValueOutputTypeDef"},{"note":"Literals for specific enumerated types.","symbol":"DecimalReturnTypeType","correct":"from mypy_boto3_rds_data.literals import DecimalReturnTypeType"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nfrom mypy_boto3_rds_data.client import RDSDataServiceClient\n\n\n# Ensure boto3 is installed: pip install boto3 mypy-boto3-rds-data\n\ndef get_rds_data_client() -> RDSDataServiceClient:\n    if TYPE_CHECKING:\n        client: RDSDataServiceClient = boto3.client(\"rds-data\")\n    else:\n        client = boto3.client(\"rds-data\")\n    return client\n\n\ndef execute_statement(sql: str, database: str, resource_arn: str, secret_arn: str) -> None:\n    client = get_rds_data_client()\n    \n    # Example: Execute SQL statement\n    response = client.execute_statement(\n        sql=sql,\n        database=database,\n        resourceArn=resource_arn,\n        secretArn=secret_arn,\n        includeResultMetadata=True\n    )\n    print(\"Statement executed.\")\n    print(response)\n\n# To run this, replace placeholders with actual AWS details:\n# sql_query = \"SELECT 1\"\n# db_name = \"your_database_name\"\n# rds_resource_arn = \"arn:aws:rds:region:account-id:cluster:cluster-name\"\n# rds_secret_arn = \"arn:aws:secretsmanager:region:account-id:secret:secret-name\"\n# execute_statement(sql_query, db_name, rds_resource_arn, rds_secret_arn)","lang":"python","description":"This quickstart demonstrates how to obtain a type-hinted RDS Data Service client and use it to execute an SQL statement. The `TYPE_CHECKING` block ensures type hints are only active during static analysis, avoiding runtime dependency on mypy-boto3-rds-data for production code."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer.","message":"Support for Python 3.8 has been removed. All `mypy-boto3-*` packages generated with `mypy-boto3-builder` version 8.12.0 or newer (including `mypy-boto3-rds-data 1.42.3`) require Python 3.9 or higher.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0, mypy-boto3-rds-data >=1.42.3"},{"fix":"Review your code for direct usage of specific TypeDef names and update them according to the new naming conventions, or rely on IDE autocompletion for the correct names.","message":"Type definition (TypeDef) names for packed method arguments have been shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Conflicting `Extra` postfixes were also moved to the end (e.g., `CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). While not specific to `rds-data`, this is a general breaking change from the underlying builder that might affect type hints for other services if specific TypeDefs are used directly.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Consider `pip install boto3-stubs-lite[rds-data]` if `lite` version exists and meets needs, or configure PyCharm to use an external type checker.","message":"PyCharm users may experience slow performance or high CPU usage due to `Literal` overloads. It is recommended to use `boto3-stubs-lite` (if available for your service) or disable PyCharm's internal type checker and use `mypy` or `pyright` externally.","severity":"gotcha","affected_versions":"All versions with PyCharm"},{"fix":"Always add explicit type hints like `client: RDSDataServiceClient = boto3.client(\"rds-data\")`.","message":"For optimal autocompletion and type checking in IDEs like VSCode and PyCharm, explicit type annotations for `boto3.client` and `boto3.session.client` calls are highly recommended, as function overload support is not always fully robust.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Implement a pattern like `if TYPE_CHECKING: from mypy_boto3_rds_data.client import RDSDataServiceClient else: RDSDataServiceClient = object`.","message":"When using the `TYPE_CHECKING` flag to prevent production dependencies, Pylint might report 'undefined variable' errors. To fix this, set all types to `object` in the non-`TYPE_CHECKING` branch.","severity":"gotcha","affected_versions":"All versions with Pylint"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}