pola-rs/polars · error · ModuleUpgradeRequiredError

writing with 'sqlalchemy' engine requires pandas >= 1.5; fou

Error message

writing with 'sqlalchemy' engine requires pandas >= 1.5; found {pd.__version__!r}

What it means

Error "writing with 'sqlalchemy' engine requires pandas >= 1.5; found {pd.__version__!r}" thrown in pola-rs/polars.

Source

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

                        msg
                    )
                else:
                    n_rows = cursor.adbc_ingest(
                        table_name=unpacked_table_name,
                        data=data,
                        mode=mode,
                        **(engine_options or {}),
                    )
                conn.commit()
            return n_rows

        elif engine == "sqlalchemy":
            if not _PANDAS_AVAILABLE:
                msg = "writing with 'sqlalchemy' engine currently requires pandas.\n\nInstall with: pip install pandas"
                raise ModuleNotFoundError(msg)
            elif (pd_version := parse_version(pd.__version__)) < (1, 5):
                msg = f"writing with 'sqlalchemy' engine requires pandas >= 1.5; found {pd.__version__!r}"
                raise ModuleUpgradeRequiredError(msg)

            import_optional(
                module_name="sqlalchemy",
                min_version=("2.0" if pd_version >= (2, 2) else "1.4"),
                min_err_prefix="pandas >= 2.2 requires",
            )
            # note: the catalog (database) should be a part of the connection string
            from sqlalchemy.engine import Connectable, create_engine
            from sqlalchemy.orm import Session

            # note: we can only dispose of engines that we create ourselves;
            # caller-supplied connectables remain the caller's responsibility
            engine_to_dispose: Engine | None = None
            sa_object: Connectable

            if isinstance(connection, str):
                sa_object = engine_to_dispose = create_engine(connection)
            elif isinstance(connection, Session):

View on GitHub (pinned to df599052da)

When it happens

Trigger: Thrown at py-polars/src/polars/dataframe/frame.py:4689 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/bcec0308ee3872c0. Report an issue: GitHub.