Repository navigation
DuckDB Python 2.0.1 is a bugfix release for the 2.0 line. It fixes the hangs and crashes at interpreter exit that 2.0.0 introduced, a number of wrong results when scanning pandas, numpy, Arrow and polars data, and several long-standing conversion bugs. It ships DuckDB v2.0.1.
Exit and shutdown
- A script that ends with an open result over a pandas object column no longer hangs at exit. Every live result is now ended by the module's exit hook, before the interpreter finalizes, including Arrow readers and capsules exported from a result (#709).
- A process whose daemon threads still run queries over Python data no longer crashes or hangs at exit on Python 3.14. A query that starts after the exit handlers ran fails with
InvalidInputException: the Python interpreter is shutting downinstead (#719, fixes #714). - The
nanobind: leaked N instances!report at exit is gone from release builds. Debug and assertion builds keep it (#784, fixes #732 and #736). We're following up with better object tracking to prevent the leaks from happening. - A
map()function that callssys.exit()no longer ends or hangs the process; it raises an engine error like every other exception from the function (#746).
Results and conversion
- A fetch whose conversion fails, such as invalid UTF-8 in a VARCHAR or a Python error from a datetime conversion, now ends its result. The next statement runs instead of failing with
ResourceInUseException(#712). TIMESTAMPTZvalues are converted to Python throughzoneinfoinstead ofpytz. A clean install no longer fails with "Required module 'pytz' failed to import", and instants from 2038 on get the right DST offset (#710, #406 and #579).- Comparing a DuckDB type with a Python class no longer constructs the class. A class is read as a numpy scalar type only when it is a concrete subclass of
numpy.generic; aKeyboardInterruptraised while an operand converts reaches the caller instead of being swallowed. Lone surrogates in identifiers and SQL text are refused with a clear error (#747).
Scanning pandas, numpy and Arrow data
- A pandas 2 categorical read through a strided view (
df[::2],iloc[1::2]) returned the rows of the full column. Strided and reversed views, tuples of arrays and pandas 2 Series now read correctly or are refused with a clear error instead ofstd::bad_cast(#711). - A sliced numeric numpy column (
iloc[1::3]) could read wrong values (#724). con.appendand SparkcreateDataFramewith a schema now convert an object column into the declared column type, cell by cell, instead of sampling the column and silently truncating values the sample missed (#739).con.appenderaccepts numpy scalars (#748).- pandas 2 dictionary-encoded string columns are read (#745).
- The Arrow importer reads three layouts it refused before: a struct or union below an offset, empty lists over a dictionary child, and a run-end encoded child inside a fixed size list. Sliced pyarrow Tables with nested struct columns are the common case (#730). Arrow refusals now name the column instead of its position (#745).
map()
map()keeps its input's column types: an ENUM no longer comes back as TINYINT with NULL as -1, and STRUCT, MAP, ARRAY, UNION, TIME_NS and nested columns no longer fail with a type mismatch. A whole chunk of NULLs in an object column no longer trips the type check (#744, #746).
Views, polars and Parquet pruning
- A view created with
to_vieworcreate_viewover a relation that reads a file-like object (read_csv(StringIO(...))) keeps working after the relation is collected (#741, fixes #477). - A polars lazy frame over a DuckDB relation pushes a filter to DuckDB only where it reads the same as polars. A filter that casts the column before comparing, such as a timestamp cast to milliseconds, no longer returns fewer rows than the eager frame (#740).
- Parquet row group pruning works for
TIMESTAMPTZandTIMEconstants that lie between two points of a coarser column, and for points before 1970 (#745).
Expression API
- Aggregate calls take an
ORDER BYinside the call:col("x").first(order_by=col("t"))andfn("first", col("x")).order_by(col("t"))render"first"("x" ORDER BY "t"). Works withFILTER,IGNORE NULLSandover()(#713).
Engine
- Ships DuckDB v2.0.1 (8d78114e9). Behavior that follows the engine: a parse error in SQL that runs aborts the active transaction;
EXECUTEof a prepared statement over aregister()ed source fails afterunregister(); every finite timestamp renders as text;read_jsonreads DECIMAL from the number's text (#721, #729, #734, #770, #772, #778 and the submodule bumps).
Build and CI
- The macOS wheels no longer carry a 10.7 deployment minimum on the module's objects (#749).
- CI test jobs install the test group with
uv sync(#728); the release workflow's S3 staging upload pins the classic transfer client and retries (#750).
Full Changelog: v2.0.0...v2.0.1