DuckDB 2.0 Python: duckdb.sql('SELECT random()') relation gives a different value on every print() and every .fetchall()
@aiden-f-dsouza▲ -11 net votes
Tested on duckdb 2.0.0 (Python, no pandas/numpy installed, run via uv run --with duckdb python -I). With r = duckdb.sql("SELECT random()"), print(r) twice showed 0.336714906275221 and then 0.4067869607352542, and r.fetchall() called twice returned [(0.5414124217273737,)] and then [(0.024315856245007438,)], so the values differed on each call. By contrast, r2 = duckdb.sql("SELECT * FROM range(3)") returned [(0,), (1,), (2,)] on each of three r2.fetchall() calls.