This is the 1.5.0 release of DuckDB's Python bindings. For a list of changes in DuckDB core, have a look at the DuckDB release notes and the blogpost.
Breaking Changes
- Dropped Python 3.9 support. The minimum supported version is now Python 3.10.
- Removed deprecated
duckdb.typingandduckdb.functionalmodules. These were deprecated in 1.4.0. Useduckdb.sqltypesandduckdb.funcinstead. - Renamed
columnparameter toexpressionin relational API functions (e.g.,min,max,sum,mean, etc.) to better reflect that these accept expressions, not just column names. - Deprecated
fetch_arrow_table()andfetch_record_batch()on connections and relations. Use the newto_arrow_table()andto_arrow_reader()methods instead.
New Features
- Polars LazyFrame projection and filter pushdown. DuckDB can now push down projections and filters when scanning Polars LazyFrames, including support for cast nodes and unstrict casts.
- Polars Int128 / UInt128 support.
- VARIANT type support — Python conversion, NumPy array wrapping, and type stubs.
- TIME_NS type support — nanosecond-precision time values across Python, NumPy, and Spark type systems.
- Profiling API — new
get_profiling_info()andget_profiling_json()methods on connections, plus a refactoredquery_graphmodule with improved HTML visualization (dark mode, expandable phases, depth). to_arrow_table()andto_arrow_reader()— new methods on connections and relations as the preferred Arrow export API.
Performance
__arrow_c_stream__on relations — relations now export via the Arrow PyCapsule interface usingPhysicalArrowCollectorfor zero-copy streaming.- Unified Arrow stream scanning via
__arrow_c_stream__, with filter pushdown only when pyarrow is present. - Arrow schema caching to avoid repeated lookups during scanning.
- Arrow object type caching to avoid repeated detection.
- Empty params treated as None for
.sql()— avoids unnecessary parameter binding overhead. - Simplified GIL management for
FetchRow.
Bug Fixes
- Fixed Python object leak in scalar UDFs —
PyObject_CallObjectreturn values are now properly stolen to avoid reference count leaks. - Fixed reference cycle between connections and relations that could prevent garbage collection.
- Relations now hold a reference to their connection, preventing premature connection closure.
- Fixed fsspec race condition in the Python filesystem implementation.
- Fixed numeric conversion logic — improved handling of large integers (fallback to VARCHAR) and UNION types.
pyarrow.datasetimport is now optional — no longer fails if pyarrow is installed without the dataset module.- Thrown a reasonable error when an Arrow array stream has already been consumed.
Build & Packaging
- jemalloc enabled on Linux x86_64 only (aligned with DuckDB core), removed as a separately bundled extension.
- MSVC runtime linked statically on Windows — eliminates the VS2019 workaround from duckdb/duckdb#17991.