{"library":"mypy-boto3-rds","title":"mypy-boto3-rds Type Annotations","description":"mypy-boto3-rds provides type annotations for the AWS boto3 RDS service, enhancing static analysis and code completion for `boto3.client(\"rds\")` and related service components. It is automatically generated by `mypy-boto3-builder` and aims to synchronize its version with the corresponding `boto3` release, offering up-to-date type hints for mypy, pyright, and various IDEs. The current version is 1.42.75, reflecting its alignment with `boto3`.","status":"active","version":"1.42.75","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","rds","type checking","mypy","pyright","stubs","dev-tool"],"install":[{"cmd":"pip install mypy-boto3-rds","lang":"bash","label":"Standalone package for RDS"},{"cmd":"pip install 'boto3-stubs[rds]'","lang":"bash","label":"Recommended: Install as part of boto3-stubs"}],"dependencies":[{"reason":"Runtime dependency for AWS SDK functionality, stubs are for this library.","package":"boto3"},{"reason":"Static type checker (optional, but primary use case).","package":"mypy","optional":true},{"reason":"Static type checker (optional, alternative to mypy).","package":"pyright","optional":true}],"imports":[{"symbol":"RDSClient","correct":"from mypy_boto3_rds.client import RDSClient"},{"note":"Example of importing a specific TypeDef.","symbol":"DescribeDBInstancesMessageTypeDef","correct":"from mypy_boto3_rds.type_defs import DescribeDBInstancesMessageTypeDef"},{"note":"Example of importing a Paginator.","symbol":"DescribeDBInstancesPaginator","correct":"from mypy_boto3_rds.paginators import DescribeDBInstancesPaginator"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\n# It is generally recommended to install 'boto3-stubs[rds]' for full integration.\n# For explicit type annotation of the client:\nif TYPE_CHECKING:\n    from mypy_boto3_rds.client import RDSClient\n    from mypy_boto3_rds.type_defs import DescribeDBInstancesMessageTypeDef\n\n    # Example of a Paginator\n    from mypy_boto3_rds.paginators import DescribeDBInstancesPaginator\n\n\n# Initialize boto3 client\n# For better type inference, explicitly annotate the client if TYPE_CHECKING is True\nclient: RDSClient = boto3.client(\"rds\") if TYPE_CHECKING else boto3.client(\"rds\")\n\ntry:\n    # Example API call with type-hinted response\n    response = client.describe_db_instances(\n        MaxRecords=20\n    )\n    # The 'response' object will have type hints based on DescribeDBInstancesMessageTypeDef\n    print(f\"Found {len(response.get('DBInstances', []))} DB instances.\")\n\n    # Example usage of a Paginator\n    paginator: DescribeDBInstancesPaginator = client.get_paginator(\"describe_db_instances\")\n    for page in paginator.paginate():\n        print(f\"Processing page with {len(page.get('DBInstances', []))} instances.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-rds` for type-hinting a `boto3` RDS client. It shows explicit type annotation for the client, an API call with type-hinted response, and usage of a paginator. The `TYPE_CHECKING` block ensures that type-only imports do not affect runtime dependencies. Note that `boto3-stubs[rds]` is the idiomatic way to install type annotations for a specific service."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or newer. The `requires_python` field is `>=3.9`.","message":"Python 3.8 support has been explicitly removed in `mypy-boto3-builder` version 8.12.0 and subsequent releases. Users on Python 3.8 or older will not receive updates or new stubs.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.x (stubs)"},{"fix":"Ensure your type checker (e.g., mypy, pyright) is up-to-date and configured to correctly resolve PEP 561 packages. Generally, this migration improves discoverability.","message":"Migration to PEP 561 compliant packages in `mypy-boto3-builder` 8.12.0. This might affect how type checkers locate stubs in complex environments or if you rely on older non-PEP 561 compliant patterns.","severity":"breaking","affected_versions":">=8.12.0 (builder), >=1.42.x (stubs)"},{"fix":"Refer to the `mypy-boto3-builder` release notes and the specific service documentation for `mypy-boto3-rds` when upgrading to check for TypeDef name changes. Update your code to use the new names.","message":"TypeDef naming conventions may change between major `mypy-boto3-builder` versions, leading to potential breaking changes if you directly import or refer to specific TypeDef names. For example, `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`.","severity":"breaking","affected_versions":">=8.9.0 (builder)"},{"fix":"Use a `from typing import TYPE_CHECKING` block. Inside this block, import the `mypy-boto3-rds` types. In the runtime path, assign `object` to these type aliases, e.g., `if TYPE_CHECKING: from mypy_boto3_rds.client import RDSClient else: RDSClient = object`.","message":"When using `mypy-boto3` stubs with linters like Pylint, you might encounter 'undefined variable' errors if you directly import stub classes without a runtime equivalent. This often happens because stubs are only for type-checking and not available at runtime.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always pin your `boto3` and `mypy-boto3-rds` (or `boto3-stubs`) versions in your `requirements.txt` or `pyproject.toml` to ensure consistency. For example: `boto3==1.x.y` and `boto3-stubs[rds]==1.x.y`.","message":"For optimal type checking, it is crucial to ensure that the version of `mypy-boto3-rds` (or `boto3-stubs`) installed matches or is compatible with the version of `boto3` you are using at runtime. Mismatched versions can lead to incorrect type hints or missing definitions.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}