pola-rs/polars · error · ModuleUpgradeRequiredError

`if_table_exists = 'replace'` requires ADBC version >= 0.7,

Error message

`if_table_exists = 'replace'` requires ADBC version >= 0.7, found {driver_manager_str_version}

What it means

Error "`if_table_exists = 'replace'` requires ADBC version >= 0.7, found {driver_manager_str_version}" thrown in pola-rs/polars.

Source

Thrown at py-polars/src/polars/dataframe/frame.py:4529

                msg = (
                    f"unrecognised connection type {qualified_type_name(connection)!r}"
                )
                raise TypeError(msg)

            driver_manager_str_version = getattr(driver_manager, "__version__", "0.0")
            driver_manager_version = parse_version(driver_manager_str_version)

            if if_table_exists == "fail":
                # if the table exists, 'create' will raise an error,
                # resulting in behaviour equivalent to 'fail'
                mode = "create"
            elif if_table_exists == "replace":
                if driver_manager_version < (0, 7):
                    msg = (
                        "`if_table_exists = 'replace'` requires ADBC version >= 0.7, "
                        f"found {driver_manager_str_version}"
                    )
                    raise ModuleUpgradeRequiredError(msg)
                mode = "replace"
            elif if_table_exists == "append":
                # 'append' inserts into an existing table; the table-existence
                # check below can upgrade this to 'create_append'.
                mode = "append"
            else:
                msg = (
                    f"unexpected value for `if_table_exists`: {if_table_exists!r}"
                    f"\n\nChoose one of {{'fail', 'replace', 'append'}}"
                )
                raise ValueError(msg)

            with (
                conn if can_close_conn else contextlib.nullcontext(),
                conn.cursor() as cursor,
            ):
                catalog, db_schema, unpacked_table_name = unpack_table_name(table_name)
                n_rows: int

View on GitHub (pinned to df599052da)

When it happens

Trigger: Thrown at py-polars/src/polars/dataframe/frame.py:4529 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@df599052da (2026-08-16). Data as JSON: /api/errors/8c7dbf6a51a7a865. Report an issue: GitHub.