{"record":{"id":"0563b1121a89448c","repo":"pola-rs/polars","slug":"pyarrow-is-required-for-adbc-driver-manager-adb","errorCode":null,"errorMessage":"pyarrow is required for adbc-driver-manager < {adbc_version_no_pyarrow_required} when using parameterized queries (via `execute_options`), found {adbc_str_version}.\nEither upgrade `adbc-driver-manager` (suggested) or install `pyarrow`","messagePattern":"pyarrow is required for adbc-driver-manager < (.+?) when using parameterized queries \\(via `execute_options`\\), 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":109,"sourceCode":"    # adbc_driver_manager must be >= 1.7.0 to support passing Python sequences into\n    # parameterised queries (via execute_options) without PyArrow installed\n    adbc_version_no_pyarrow_required = \"1.7.0\"\n    has_required_adbc_version = adbc_version >= parse_version(\n        adbc_version_no_pyarrow_required\n    )\n\n    if (\n        execute_options is not None\n        and not _PYARROW_AVAILABLE\n        and not has_required_adbc_version\n    ):\n        msg = (\n            \"pyarrow is required for adbc-driver-manager < \"\n            f\"{adbc_version_no_pyarrow_required} when using parameterized queries (via \"\n            f\"`execute_options`), found {adbc_str_version}.\\nEither upgrade \"\n            \"`adbc-driver-manager` (suggested) or install `pyarrow`\"\n        )\n        raise ModuleUpgradeRequiredError(msg)\n\n    # From adbc_driver_manager version 1.6.0 Cursor.fetch_arrow() was introduced,\n    # returning an object implementing the Arrow PyCapsule interface. This should be\n    # used regardless of whether PyArrow is available.\n    fetch_method_name = (\n        \"fetch_arrow\" if adbc_version >= (1, 6, 0) else \"fetch_arrow_table\"\n    )\n\n    from polars import DataFrame\n\n    with _open_adbc_connection(connection_uri) as conn, conn.cursor() as cursor:\n        cursor.execute(query, **(execute_options or {}))\n        tbl = getattr(cursor, fetch_method_name)()\n        return DataFrame(tbl, schema_overrides=schema_overrides)  # type: ignore[return-value]\n\n\ndef _get_adbc_driver_name_from_uri(connection_uri: str) -> str:\n    driver_name = connection_uri.split(\":\", 1)[0].lower()","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/py-polars/src/polars/io/database/_utils.py#L91-L127","documentation":"When using the adbc engine of read_database_uri with parameterized queries (`execute_options`), adbc-driver-manager older than the version that removed the pyarrow requirement needs pyarrow installed. If both conditions hold (old adbc + no pyarrow), polars raises ModuleUpgradeRequiredError explaining the two ways out.","triggerScenarios":"Calling `read_database_uri(query, uri, engine=\"adbc\", execute_options={...})` where adbc-driver-manager < adbc_version_no_pyarrow_required and pyarrow is not installed.","commonSituations":"Lean installs that deliberately avoid pyarrow (using the Arrow PyCapsule interface) combined with an outdated adbc-driver-manager; CI images pinned to old adbc versions.","solutions":["Upgrade adbc-driver-manager: `pip install -U 'adbc-driver-manager>=1.6.0'` (suggested).","Install pyarrow: `pip install pyarrow`.","Drop `execute_options` and inline the parameters into the SQL query string."],"exampleFix":"// before\npl.read_database_uri(\"SELECT * FROM t WHERE id = ?\", uri, engine=\"adbc\", execute_options={\"parameters\": [42]})\n# raises: no pyarrow, old adbc\n// after\n# pip install -U 'adbc-driver-manager>=1.6.0'  (or: pip install pyarrow)\npl.read_database_uri(\"SELECT * FROM t WHERE id = ?\", uri, engine=\"adbc\", execute_options={\"parameters\": [42]})","handlingStrategy":"validation","validationCode":"import importlib.metadata as md\nver = tuple(int(x) for x in md.version(\"adbc-driver-manager\").split(\".\")[:2])\nif ver < (1, 6, 0):\n    try:\n        import pyarrow  # noqa\n    except ImportError:\n        raise RuntimeError(\"need adbc-driver-manager>=1.6.0 or pyarrow for execute_options\")","typeGuard":null,"tryCatchPattern":"from polars.io.database import ModuleUpgradeRequiredError\ntry:\n    df = pl.read_database_uri(q, uri, engine=\"adbc\", execute_options=opts)\nexcept ModuleUpgradeRequiredError:\n    df = pl.read_database_uri(q.replace(\"?\", str(param)), uri, engine=\"adbc\")","preventionTips":["Pin adbc-driver-manager>=1.6.0 wherever execute_options is used","In pyarrow-free environments, verify adbc version in CI","Keep driver stack (driver-manager + driver packages) versions in lockstep"],"tags":["polars","adbc","pyarrow","dependency-version","parameterized-query"],"backgroundTag":"missing-dependency","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}