{"id":3352,"library":"mypy-boto3-databrew","title":"mypy-boto3-databrew Type Stubs","description":"mypy-boto3-databrew provides comprehensive type annotations for the AWS GlueDataBrew service, enhancing developer experience with static type checking and IDE auto-completion for boto3. It is part of the `mypy-boto3-builder` ecosystem, which generates stubs for all AWS services. The library is actively maintained with frequent updates to align with boto3 releases and new AWS service features, typically on a monthly cadence.","status":"active","version":"1.42.3","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","stub","databrew"],"install":[{"cmd":"pip install mypy-boto3-databrew boto3 mypy","lang":"bash","label":"Install standalone stubs with boto3 and mypy"},{"cmd":"pip install 'boto3-stubs[databrew]' boto3 mypy","lang":"bash","label":"Install as part of boto3-stubs collection"}],"dependencies":[{"reason":"Provides the underlying AWS SDK for Python that these type stubs annotate.","package":"boto3","optional":false},{"reason":"The primary static type checker that these stubs are designed to work with.","package":"mypy","optional":false}],"imports":[{"note":"Import the specific client type for GlueDataBrew.","symbol":"GlueDataBrewClient","correct":"from mypy_boto3_databrew.client import GlueDataBrewClient"},{"note":"Import specific TypedDicts for request/response bodies.","symbol":"BatchPutDataBrewJobResponseTypeDef","correct":"from mypy_boto3_databrew.type_defs import BatchPutDataBrewJobResponseTypeDef"}],"quickstart":{"code":"import boto3\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n    from mypy_boto3_databrew.client import GlueDataBrewClient\n    from mypy_boto3_databrew.type_defs import ListRecipesResponseTypeDef\n\ndef get_databrew_recipes() -> ListRecipesResponseTypeDef:\n    # Initialize the DataBrew client with type annotation\n    client: GlueDataBrewClient = boto3.client(\"databrew\")\n    \n    # Use the client with type-hinted methods and expected return types\n    response: ListRecipesResponseTypeDef = client.list_recipes(MaxResults=5)\n    print(f\"Found {len(response['Recipes'])} DataBrew recipes.\")\n    for recipe in response.get('Recipes', []):\n        print(f\"- {recipe['Name']} (ARN: {recipe['Arn']})\")\n    return response\n\nif __name__ == \"__main__\":\n    # Ensure AWS credentials are configured (e.g., via AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_REGION)\n    # For a runnable example without actual AWS calls, you might mock boto3 or use a dummy client.\n    # This example assumes valid AWS credentials are set up.\n    print(\"Listing DataBrew recipes...\")\n    try:\n        get_databrew_recipes()\n    except Exception as e:\n        print(f\"Error fetching DataBrew recipes: {e}\")\n        print(\"Please ensure AWS credentials and region are configured correctly.\")\n","lang":"python","description":"This quickstart demonstrates how to use `mypy-boto3-databrew` to add type hints to your boto3 GlueDataBrew client. It explicitly imports the `GlueDataBrewClient` type and a sample response `TypedDict` for improved type checking and auto-completion. The example initializes a DataBrew client and lists recipes, showcasing how type annotations benefit method calls and return values."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later version.","message":"Support for Python 3.8 has been removed in `mypy-boto3-builder` version 8.12.0 and subsequently in generated packages. Ensure your project uses Python 3.9 or newer.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.12.0"},{"fix":"Review and update explicit `TypedDict` imports and usage to reflect the new naming conventions.","message":"TypeDef names for packed method arguments were shortened (e.g., `CreateDistributionRequestRequestTypeDef` became `CreateDistributionRequestTypeDef`). Conflicting `Extra` postfixes were moved to the end (`CreateDistributionExtraRequestTypeDef` to `CreateDistributionRequestExtraTypeDef`). This may require updates to explicit `TypedDict` imports in your code.","severity":"breaking","affected_versions":"mypy-boto3-builder >=8.9.0"},{"fix":"Consider `pip install 'boto3-stubs-lite[databrew]'` or configure your IDE to use an external type checker.","message":"For optimal performance and correct type resolution in PyCharm, especially with Literal overloads, it is recommended to use `boto3-stubs-lite` instead of the full stubs. Alternatively, disable PyCharm's internal type checker and rely on external tools like `mypy` or `pyright`.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure `boto3` and `mypy` are included in your project's dependencies (`pip install boto3 mypy`).","message":"While `mypy-boto3-databrew` provides type information, `boto3` and `mypy` (or another type checker) must be installed separately for the stubs to be effective. The stubs do not include the runtime library itself.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always explicitly annotate your client creation, e.g., `client: GlueDataBrewClient = boto3.client('databrew')`.","message":"Explicit type annotations for `boto3.client()` calls are often recommended or necessary for the best type-checking and auto-completion experience, especially with IDEs like VSCode and PyCharm, as automatic type discovery may not always be fully reliable or performant.","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"}