{"id":2606,"library":"mypy-boto3-lakeformation","title":"mypy-boto3-lakeformation Type Annotations for AWS LakeFormation","description":"mypy-boto3-lakeformation provides comprehensive type annotations for the AWS LakeFormation service, enhancing static type checking for `boto3` interactions. It ensures compatibility with tools like mypy, pyright, VSCode, and PyCharm by offering type definitions for clients, paginators, literals, and TypeDefs. Currently at version 1.42.79, it is actively maintained with frequent updates, often aligning with new `boto3` releases and driven by the `mypy-boto3-builder` project (version 8.12.0).","status":"active","version":"1.42.79","language":"en","source_language":"en","source_url":"https://github.com/youtype/mypy_boto3_builder","tags":["aws","boto3","mypy","type-hints","lakeformation","static-analysis","stubs"],"install":[{"cmd":"pip install mypy-boto3-lakeformation","lang":"bash","label":"Direct Installation"},{"cmd":"pip install 'boto3-stubs[lakeformation]'","lang":"bash","label":"Via boto3-stubs meta-package"}],"dependencies":[{"reason":"Provides runtime functionality; mypy-boto3-lakeformation only offers type stubs for boto3.","package":"boto3","optional":false},{"reason":"Requires Python 3.9 or newer.","package":"python","optional":false}],"imports":[{"symbol":"LakeFormationClient","correct":"from mypy_boto3_lakeformation.client import LakeFormationClient"},{"symbol":"GetDataLakeSettingsResponseTypeDef","correct":"from mypy_boto3_lakeformation.type_defs import GetDataLakeSettingsResponseTypeDef"},{"symbol":"PrincipalPermissionsTypeDef","correct":"from mypy_boto3_lakeformation.type_defs import PrincipalPermissionsTypeDef"}],"quickstart":{"code":"import boto3\nfrom mypy_boto3_lakeformation.client import LakeFormationClient\nfrom mypy_boto3_lakeformation.type_defs import (\n    GetDataLakeSettingsResponseTypeDef,\n    PrincipalPermissionsTypeDef\n)\n\n# Initialize boto3 client with explicit type annotation for static checking\n# Make sure to have AWS credentials configured (e.g., via environment variables or ~/.aws/credentials)\nclient: LakeFormationClient = boto3.client(\"lakeformation\", region_name=\"us-east-1\")\n\ntry:\n    # Example: Get Data Lake Settings\n    response: GetDataLakeSettingsResponseTypeDef = client.get_data_lake_settings()\n\n    print(\"Successfully retrieved Data Lake Settings:\")\n    # Accessing type-hinted response data\n    if \"DataLakeSettings\" in response:\n        settings = response[\"DataLakeSettings\"]\n        if \"DataLakeAdmins\" in settings and settings[\"DataLakeAdmins\"]:\n            admin: PrincipalPermissionsTypeDef = settings[\"DataLakeAdmins\"][0]\n            print(f\"  First Data Lake Admin Principal: {admin['DataPrincipalIdentifier']}\")\n        else:\n            print(\"  No Data Lake Admins found.\")\n    else:\n        print(\"  'DataLakeSettings' key not found in response.\")\n\nexcept Exception as e:\n    print(f\"An error occurred: {e}\")","lang":"python","description":"This quickstart demonstrates how to initialize a `boto3` LakeFormation client with explicit type annotations and interact with it. It fetches the Data Lake settings and attempts to print the first Data Lake admin, leveraging `mypy-boto3-lakeformation`'s type definitions for enhanced code completion and error checking."},"warnings":[{"fix":"Upgrade your Python environment to 3.9 or a later supported version.","message":"Starting with `mypy-boto3-builder` 8.12.0 (and corresponding `mypy-boto3-*` releases like 1.42.79 for LakeFormation), Python 3.8 is no longer supported. Projects must use Python 3.9 or newer.","severity":"breaking","affected_versions":">=1.42.79"},{"fix":"Ensure `boto3` is installed in your environment: `pip install boto3`.","message":"`mypy-boto3-lakeformation` provides only type annotations (`.pyi` stub files). You must also install the `boto3` library itself for your code to run. These stubs do not provide `boto3`'s runtime functionality.","severity":"gotcha","affected_versions":"all"},{"fix":"Align the `mypy-boto3-lakeformation` version with your `boto3` version (e.g., if `boto3` is `1.42.x`, install `mypy-boto3-lakeformation==1.42.x`).","message":"For optimal and accurate type checking, the version of `mypy-boto3-lakeformation` should ideally match the major and minor version of your installed `boto3` library. Mismatched versions can lead to incorrect type hints or unresolved references.","severity":"gotcha","affected_versions":"all"},{"fix":"Review your `TypeDef` imports and adjust names according to the updated conventions, typically by removing redundant 'Request' or 'Response' suffixes where applicable.","message":"The `mypy-boto3-builder` (which generates this package) introduced breaking changes to `TypeDef` naming conventions in version 8.9.0. If you explicitly imported TypeDefs with older, longer names (e.g., `CreateDistributionRequestRequestTypeDef`), they might have been shortened (e.g., to `CreateDistributionRequestTypeDef`).","severity":"breaking","affected_versions":">=1.42.x (generated by builder >=8.9.0)"}],"env_vars":null,"last_verified":"2026-04-10T00:00:00.000Z","next_check":"2026-07-09T00:00:00.000Z"}