{"record":{"id":"1292aa03cb70f96d","repo":"pola-rs/polars","slug":"currently-no-support-for-self-driver-name-r-conn","errorCode":null,"errorMessage":"Currently no support for {self.driver_name!r} connection {self.cursor!r}","messagePattern":"Currently no support for (.+?) connection (.+?)","errorType":"exception","errorClass":"NotImplementedError","httpStatus":null,"severity":"error","filePath":"py-polars/src/polars/io/database/_executor.py","lineNumber":622,"sourceCode":"            self._from_arrow,  # init from arrow-native data (where support exists)\n            self._from_rows,  # row-wise fallback (sqlalchemy, dbapi2, pyodbc, etc)\n        ):\n            frame = frame_init(\n                batch_size=batch_size,\n                iter_batches=iter_batches,\n                schema_overrides=schema_overrides,\n                infer_schema_length=infer_schema_length,\n            )\n            if frame is not None:\n                if defer_cursor_close:\n                    frame_cursor = CloseAfterFrameIter(frame, cursor=self.cursor)\n                    frame = (df for df in frame_cursor)\n                return frame\n\n        msg = (\n            f\"Currently no support for {self.driver_name!r} connection {self.cursor!r}\"\n        )\n        raise NotImplementedError(msg)\n","sourceCodeStart":604,"sourceCodeEnd":623,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/py-polars/src/polars/io/database/_executor.py#L604-L623","documentation":"Raised by ConnectionExecutor.to_polars() when neither _from_arrow nor _from_rows can initialise a frame from the given cursor/result object. Polars recognises a fixed set of driver cursor types (arrow-native drivers, SQLAlchemy, DBAPI2, pyodbc, etc.); anything else falls through to this NotImplementedError naming the driver and cursor class.","triggerScenarios":"Passing an exotic or custom cursor/connection object to pl.read_database() whose type is not in the supported driver registry; a newer/renamed cursor class from a driver version polars does not yet recognise; wrapping a cursor in a proxy object that hides its real class.","commonSituations":"Using a niche database driver or an in-house connection wrapper; running a bleeding-edge driver version that renamed its cursor classes; passing a turbodbc/duckdb lower-level object instead of the standard DBAPI surface.","solutions":["Pass a standard surface polars supports: a SQLAlchemy Engine/Connection, a DBAPI-compliant connection, or a pyodbc connection","Use pl.read_database_uri() with the connectorx or adbc engine if a URI is available for that database","Upgrade polars — support for additional drivers is added over time and the cursor class may simply be too new","As a last resort, fetch rows with the driver's own API and construct pl.DataFrame(rows, schema=...) manually"],"exampleFix":"# before\ndf = pl.read_database(query, exotic_driver_session)  # unsupported cursor type\n\n# after\ndf = pl.read_database_uri(query, \"sqlite:///data.db\", engine=\"adbc\")\n# or\ndf = pl.DataFrame(exotic_cursor.fetchall(), schema=pl.Schema({...}))","handlingStrategy":"try-catch","validationCode":"SUPPORTED_MODULES = (\"sqlalchemy\", \"pyodbc\", \"adbc\")\nmodule = type(connection).__module__.split(\".\", 1)[0]\nif not module.startswith(SUPPORTED_MODULES):\n    # fall back to manual fetch before calling read_database\n    ...","typeGuard":null,"tryCatchPattern":"try:\n    df = pl.read_database(query, conn)\nexcept NotImplementedError:\n    rows = conn.cursor().execute(query).fetchall()  # driver-native fetch\n    df = pl.DataFrame(rows, orient=\"row\", schema_overrides=schema)","preventionTips":["Standardise on SQLAlchemy connections or pyodbc for read_database","Prefer read_database_uri with adbc/connectorx for supported databases","Keep polars current — driver coverage grows release over release"],"tags":["database","driver-support","not-implemented"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}