{"id":3155,"library":"mypy-boto3-timestream-query","title":"mypy-boto3-timestream-query stubs","description":"mypy-boto3-timestream-query provides type annotations (stubs) for the `boto3` Timestream Query service, enhancing static analysis with tools like MyPy. It is actively maintained by the `youtype/mypy_boto3_builder` project, with versions updated frequently to align with new `boto3` releases and improvements to the builder itself. The current version is 1.42.3.","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","type-stubs","timestream","timestream-query"],"install":[{"cmd":"pip install boto3 mypy-boto3-timestream-query","lang":"bash","label":"Install Boto3 and stubs"},{"cmd":"pip install 'boto3>=1.28.0,<1.29.0' 'mypy-boto3-timestream-query>=1.42.3,<1.43.0'","lang":"bash","label":"Pin specific versions for stability"}],"dependencies":[{"reason":"Runtime library for which these are type stubs. Required for actual AWS API calls.","package":"boto3"},{"reason":"Static type checker that consumes these stubs for analysis.","package":"mypy","optional":true}],"imports":[{"note":"Type stubs are imported from the dedicated `mypy_boto3_` package, not directly from `boto3`.","wrong":"from boto3.timestream_query import TimestreamQueryClient","symbol":"TimestreamQueryClient","correct":"from mypy_boto3_timestream_query.client import TimestreamQueryClient"},{"note":"Most generated TypeDefs are located in the `type_defs` submodule for clarity.","wrong":"from mypy_boto3_timestream_query import ListDatabasesResponseTypeDef","symbol":"ListDatabasesResponseTypeDef","correct":"from mypy_boto3_timestream_query.type_defs import ListDatabasesResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_timestream_query.client import TimestreamQueryClient\nfrom mypy_boto3_timestream_query.type_defs import ListDatabasesResponseTypeDef\n\n# Initialize a boto3 client. Mypy will use the stubs for type checking.\n# Ensure AWS credentials are configured (e.g., via environment variables, ~/.aws/credentials)\nclient: TimestreamQueryClient = boto3.client(\"timestream-query\")\n\n# Example API call with type hinting\ntry:\n    print(\"Attempting to list Timestream databases...\")\n    response: ListDatabasesResponseTypeDef = client.list_databases()\n    databases = response.get(\"Databases\", [])\n    if databases:\n        print(\"Timestream Databases:\")\n        for db in databases:\n            print(f\"- {db.get('DatabaseName')}\")\n    else:\n        print(\"No Timestream databases found.\")\nexcept Exception as e:\n    print(f\"Error listing databases: {e}\")\n    print(\"Ensure you have configured AWS credentials with permissions for Timestream Query.\")","lang":"python","description":"Demonstrates how to initialize a `boto3` Timestream Query client and use the `mypy-boto3-timestream-query` stubs for type-hinted API calls. This code requires valid AWS credentials with access to Timestream Query to run successfully."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or higher, or explicitly pin `mypy-boto3-timestream-query<1.42.3` to use an older compatible version.","message":"Python 3.8 support was removed for `mypy-boto3-builder` versions 8.12.0 and later, which includes `mypy-boto3-timestream-query` 1.42.3 and newer. Users on Python 3.8 will encounter installation or runtime errors with these versions.","severity":"breaking","affected_versions":">=1.42.3"},{"fix":"Verify that your type checker (e.g., MyPy) correctly resolves imports. If issues arise, check your `mypy` configuration (e.g., `MYPYPATH`) and update as necessary. For most users, no action is required.","message":"The `mypy-boto3-builder` project migrated to PEP 561 compliant namespace packages in version 8.12.0. While largely transparent, this change could affect how type checkers discover packages in complex or non-standard environments.","severity":"breaking","affected_versions":">=1.42.3"},{"fix":"Always install `boto3` alongside `mypy-boto3-timestream-query`.","message":"These packages provide *type stubs* for `boto3`, not the `boto3` library itself. You must install `boto3` separately (e.g., `pip install boto3`) for runtime functionality. Without `boto3`, your code will fail at runtime.","severity":"gotcha","affected_versions":"all"},{"fix":"Keep `boto3` and `mypy-boto3-timestream-query` versions aligned. For example, `boto3==1.28.x` should ideally be paired with `mypy-boto3-timestream-query==1.42.x`.","message":"For accurate type checking, the version of `mypy-boto3-timestream-query` should ideally synchronize with the major and minor version of your installed `boto3` library. Significant mismatches can lead to incorrect or missing type hints.","severity":"gotcha","affected_versions":"all"},{"fix":"Review the `mypy-boto3-builder` release notes for `8.9.0` and later, and update any directly referenced TypeDef names in your code to match the new convention.","message":"In `mypy-boto3-builder` 8.9.0, the naming conventions for some generated TypeDefs were shortened or adjusted to resolve conflicts (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). This may require updates if you directly reference generated TypeDef names in your code.","severity":"breaking","affected_versions":"~>1.38.0"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}