{"id":23525,"library":"dbutils-typehint","title":"DBUtils Type Hint","description":"Provides type hints for Databricks DBUtils (dbutils), enabling IDE autocompletion and static type checking. Version 0.1.9, maintained as a stub-type package with periodic updates to match Databricks runtime changes.","status":"active","version":"0.1.9","language":"python","source_language":"en","source_url":"https://github.com/cdeler/dbutils_typehint","tags":["databricks","type-hints","dbutils","stubs"],"install":[{"cmd":"pip install dbutils-typehint","lang":"bash","label":"Standard installation"}],"dependencies":[],"imports":[{"note":"The package is imported as a module, not a subpackage of dbutils.","wrong":"from dbutils import typehint","symbol":"dbutils_typehint","correct":"import dbutils_typehint"}],"quickstart":{"code":"import dbutils_typehint\nfrom typing import Optional\n\n# Use dbutils in a typable way\ndbutils.fs.ls('/mnt/data')  # Now has type hints enabled\n# Explicitly annotate if needed\nresult: Optional[list] = dbutils.fs.ls('/tmp')","lang":"python","description":"Import the module to activate type hints for dbutils. No direct usage required; the module patches dbutils objects at import time."},"warnings":[{"fix":"Switch to 'pip install dbutils-stubs' for Databricks Runtime 10+.","message":"This package is effectively unmaintained; last release 2022. Use 'dbutils-stubs' or 'databricks-sdk' for newer Databricks runtimes.","severity":"deprecated","affected_versions":">=0.1.9"},{"fix":"Place 'import dbutils_typehint' at the very top of your script, before other imports that use dbutils.","message":"Import order matters: must import 'dbutils_typehint' BEFORE any use of dbutils. Otherwise type hints won't activate.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider using 'databricks-connect' or the official Databricks SDK for better type support.","message":"The package relies on monkey-patching and may not work with some IDEs or static type checkers (e.g., Pyright) that enforce strict import restrictions.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run code only in Databricks environment. For local testing, use 'databricks-connect' or mock dbutils.","cause":"dbutils not available in local environment; this package only provides type hints, not runtime implementation.","error":"AttributeError: module 'dbutils' has no attribute 'fs'"},{"fix":"Use 'import dbutils_typehint' (not 'from dbutils import ...').","cause":"Incorrect import path: attempting to import from 'dbutils' instead of the top-level package.","error":"ImportError: cannot import name 'dbutils_typehint' from 'dbutils'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}