{"id":3075,"library":"mypy-boto3-dms","title":"Type annotations for boto3 DatabaseMigrationService","description":"mypy-boto3-dms provides PEP 561 compatible type annotations (stubs) for the `boto3` AWS Database Migration Service (DMS) client. This package helps static type checkers like Mypy, Pyright, and IDEs (VSCode, PyCharm) provide better autocompletion, error detection, and overall developer experience when working with `boto3`'s DMS client. It is currently at version 1.42.80 and is frequently updated to align with `boto3` releases.","status":"active","version":"1.42.80","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["AWS","boto3","mypy","type hints","stubs","DMS","Database Migration Service"],"install":[{"cmd":"pip install mypy-boto3-dms boto3 mypy","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Runtime dependency for interacting with AWS services.","package":"boto3","optional":false},{"reason":"Required for static type checking.","package":"mypy","optional":false}],"imports":[{"note":"Primary client type for DMS.","symbol":"DatabaseMigrationServiceClient","correct":"from mypy_boto3_dms.client import DatabaseMigrationServiceClient"},{"note":"Example TypeDef for API response structures.","symbol":"DescribeReplicationTasksResponseTypeDef","correct":"from mypy_boto3_dms.type_defs import DescribeReplicationTasksResponseTypeDef"},{"note":"Example Literal type for specific string values.","symbol":"AssessmentReportTypeType","correct":"from mypy_boto3_dms.literals import AssessmentReportTypeType"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\nfrom os import environ\n\nif TYPE_CHECKING:\n    from mypy_boto3_dms.client import DatabaseMigrationServiceClient\n    from mypy_boto3_dms.type_defs import DescribeReplicationTasksResponseTypeDef\n\ndef list_dms_replication_tasks() -> \"DescribeReplicationTasksResponseTypeDef\":\n    \"\"\"Lists DMS replication tasks with type hints.\"\"\"\n    # Explicitly type the client for enhanced IDE support and static analysis.\n    client: DatabaseMigrationServiceClient = boto3.client(\n        \"dms\",\n        region_name=environ.get(\"AWS_REGION\", \"us-east-1\"),\n        aws_access_key_id=environ.get(\"AWS_ACCESS_KEY_ID\", \"TEST_ACCESS_KEY\"),\n        aws_secret_access_key=environ.get(\"AWS_SECRET_ACCESS_KEY\", \"TEST_SECRET_KEY\"),\n    )\n    response = client.describe_replication_tasks()\n    print(\"DMS Replication Tasks:\", response.get(\"ReplicationTasks\"))\n    return response\n\nif __name__ == \"__main__\":\n    list_dms_replication_tasks()","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` DMS client with type annotations and perform a simple API call. The `TYPE_CHECKING` block ensures that type-only imports do not incur runtime overhead. Replace placeholder environment variables with actual AWS credentials for real use."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version.","message":"Python 3.8 support was removed starting with `mypy-boto3-builder` version 8.12.0. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.12.0 (affecting mypy-boto3-dms from this version onwards)"},{"fix":"Update your code to reflect the new TypeDef naming conventions if you were using explicitly imported TypeDefs that matched these patterns.","message":"TypeDef naming conventions changed in `mypy-boto3-builder` 8.9.0. Some packed method arguments now use shorter names (e.g., `RequestRequestTypeDef` -> `RequestTypeDef`), and conflicting `Extra` postfixes were moved (`ExtraRequestTypeDef` -> `RequestExtraTypeDef`). While this applies generally to generated service stubs, it may impact DMS TypeDefs if such patterns were used.","severity":"breaking","affected_versions":"mypy-boto3-builder >= 8.9.0 (affecting mypy-boto3-dms from this version onwards)"},{"fix":"Consider installing `boto3-stubs-lite` (if available for DMS) or configure PyCharm to use external type checkers like Mypy/Pyright for `boto3` code.","message":"PyCharm may experience slow performance or high CPU usage with `Literal` overloads, a common pattern in `mypy-boto3` stubs. It is recommended to use `boto3-stubs-lite` or disable PyCharm's internal type checker in favor of `mypy` or `pyright`.","severity":"gotcha","affected_versions":"All versions, specifically with PyCharm"},{"fix":"Add explicit type annotations, as shown in the quickstart example: `client: DatabaseMigrationServiceClient = boto3.client(\"dms\")`.","message":"While many IDEs offer auto-discovery, explicitly annotating your `boto3.client('dms')` calls with `DatabaseMigrationServiceClient` provides the most robust type checking and autocompletion experience.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `mypy-boto3-dms` is installed via `pip` (or equivalent package manager) in the environment where your type checker runs. Avoid relying on `MYPYPATH` for stub-only packages.","message":"`mypy-boto3-dms` is a stub-only package (PEP 561) and does not contain any runtime code. It must be installed in the same Python environment as `boto3` and `mypy` for type checkers to correctly find and utilize its type information.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}