{"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/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/database/_utils.py#L91-L127","documentation":"Raised by _read_sql_adbc when parameterized queries are used (execute_options is not None), PyArrow is not installed, and adbc-driver-manager is older than the version (1.7.0) that can pass Python sequences as bind parameters without PyArrow. Without either piece, the ADBC binding path cannot serialise query parameters.","triggerScenarios":"pl.read_database_uri(..., engine='adbc', execute_options={'parameters': (...)}) with adbc-driver-manager < 1.7.0 and no pyarrow in the environment.","commonSituations":"Minimal cloud/lambda images that deliberately exclude pyarrow to save space; adbc-driver-manager installed as a transitive dependency at an older pin; adopting parameterized queries (the safer SQL style) in an existing adbc setup.","solutions":["Upgrade the driver manager: pip install -U 'adbc-driver-manager>=1.7.0' (suggested by the error itself)","Or install pyarrow: pip install pyarrow","Or drop execute_options and inline/escape the literals (least preferred, loses parameterization safety)"],"exampleFix":"# before: adbc-driver-manager 1.5, no pyarrow\npl.read_database_uri(q, uri, engine=\"adbc\", execute_options={\"parameters\": (40, 20)})\n\n# after\npip install -U 'adbc-driver-manager>=1.7.0'","handlingStrategy":"validation","validationCode":"from importlib.metadata import version\nfrom packaging.version import parse\n\nNEEDS = parse(\"1.7.0\")\nif execute_options and parse(version(\"adbc_driver_manager\")) < NEEDS:\n    try:\n        import pyarrow  # noqa: F401\n    except ImportError:\n        raise RuntimeError(\"upgrade adbc-driver-manager>=1.7.0 or install pyarrow\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pin adbc-driver-manager>=1.7.0 whenever parameterized ADBC queries are used","In pyarrow-free images, add an explicit startup check for this combination","Treat adbc-driver-manager as a first-class pinned dependency, not transitive"],"tags":["database","adbc","pyarrow","version","dependency"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}