{"record":{"id":"68db8fcc1946606f","repo":"pola-rs/polars","slug":"pyarrow-is-required-for-adbc-driver-manager-1-6","errorCode":null,"errorMessage":"pyarrow is required for adbc-driver-manager < 1.6.0, found {adbc_str_version}.\nEither upgrade `adbc-driver-manager` (suggested) or install `pyarrow`","messagePattern":"pyarrow is required for adbc-driver-manager < 1\\.6\\.0, found (.+?)\\.\nEither upgrade `adbc-driver-manager` \\(suggested\\) or install `pyarrow`","errorType":"exception","errorClass":"ModuleUpgradeRequiredError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/database/_utils.py","lineNumber":174,"sourceCode":"    )\n    if not dbapi_submodule:\n        return adbc_driver\n    # Importing the dbapi without pyarrow before adbc_driver_manager 1.6.0\n    # raises ImportError: PyArrow is required for the DBAPI-compatible interface\n    # Use importlib.import_module because Polars' import_optional clobbers this error\n    try:\n        adbc_driver_dbapi = import_module(f\"{module_name}.dbapi\")\n    except ImportError as e:\n        if \"PyArrow is required for the DBAPI-compatible interface\" in (str(e)):\n            adbc_driver_manager = import_optional(\"adbc_driver_manager\")\n            adbc_str_version = getattr(adbc_driver_manager, \"__version__\", \"0.0\")\n\n            msg = (\n                \"pyarrow is required for adbc-driver-manager < 1.6.0, found \"\n                f\"{adbc_str_version}.\\nEither upgrade `adbc-driver-manager` (suggested) or \"\n                \"install `pyarrow`\"\n            )\n            raise ModuleUpgradeRequiredError(msg) from None\n        # if the error message was something different, re-raise it\n        raise\n    else:\n        return adbc_driver_dbapi\n\n\ndef _open_adbc_connection(connection_uri: str) -> Any:\n    driver_name = _get_adbc_driver_name_from_uri(connection_uri)\n    module_name = _get_adbc_module_name_from_uri(connection_uri)\n    adbc_driver = _import_optional_adbc_driver(module_name)\n\n    # some backends require the driver name to be stripped from the URI\n    if driver_name in (\"duckdb\", \"snowflake\", \"sqlite\"):\n        connection_uri = re.sub(f\"^{driver_name}:/{{,3}}\", \"\", connection_uri)\n\n    return adbc_driver.connect(connection_uri)\n\n","sourceCodeStart":156,"sourceCodeEnd":192,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/database/_utils.py#L156-L192","documentation":"Raised while importing a backend driver's dbapi module when the import fails with the backend's own 'PyArrow is required for the DBAPI-compatible interface' message. ADBC backend dbapi modules older than 1.6.0 hard-require PyArrow; polars intercepts that ImportError and re-raises it as ModuleUpgradeRequiredError with actionable guidance.","triggerScenarios":"pl.read_database_uri(..., engine='adbc') for any backend (e.g. adbc-driver-sqlite, adbc-driver-postgresql) where the installed driver's dbapi module needs PyArrow and pyarrow is absent.","commonSituations":"Slipstream installs of adbc drivers pulled in without pyarrow; slim Docker images; version drift where adbc-driver-manager is new but an individual backend driver is old.","solutions":["Install pyarrow: pip install pyarrow","Or upgrade the whole adbc stack to >= 1.6.0: pip install -U 'adbc-driver-manager>=1.6.0' plus matching backend drivers, whose dbapi no longer hard-requires pyarrow","Check pip show adbc-driver-manager and each adbc-driver-* package to find the stale one"],"exampleFix":"# before\npip install adbc-driver-sqlite  # no pyarrow, driver dbapi needs it\n\n# after\npip install pyarrow\n# or\npip install -U 'adbc-driver-manager>=1.6.0' adbc-driver-sqlite","handlingStrategy":"validation","validationCode":"try:\n    import pyarrow  # noqa: F401\n    HAS_PA = True\nexcept ImportError:\n    HAS_PA = False\n\nif not HAS_PA:\n    from importlib.metadata import version\n    from packaging.version import parse\n    assert parse(version(\"adbc_driver_manager\")) >= (1, 6, 0), \"install pyarrow or upgrade adbc stack\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Install pyarrow alongside any adbc-driver-* backend unless the whole stack is >= 1.6.0","Verify each adbc-driver-<backend> version, not just the manager","Smoke-test one adbc read at deploy time to surface import-time failures early"],"tags":["database","adbc","pyarrow","dependency","import-error"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}