What happens?
Calling .pl(lazy=True) on a DuckDB query result and then using Polars operations (such as getting the len of the LazyFrame) cause a polars.exceptions.ComputeError.
polars.exceptions.ComputeError: caught exception during execution of a Python source, exception: AttributeError: 'NoneType' object has no attribute 'fetch_arrow_reader'
Interestingly, this error only happens when using con = duckdb.connect(), using duckdb.sql like described in https://duckdb.org/docs/stable/guides/python/polars#duckdb-to-polars works fine
To Reproduce
import duckdb
import polars as pl
con = duckdb.connect()
results = con.execute("""
SELECT 1 AS id, 'banana' AS fruit
""").pl(lazy=True)
print(results.select(pl.len()).collect().item())
OS:
iOS
DuckDB Version:
1.4.2
DuckDB Client:
Python
Hardware:
No response
Full Name:
Denis Lusson
Affiliation:
Corvic AI
Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?
Did you include all code required to reproduce the issue?
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set
What happens?
Calling .pl(lazy=True) on a DuckDB query result and then using Polars operations (such as getting the len of the LazyFrame) cause a polars.exceptions.ComputeError.
Interestingly, this error only happens when using
con = duckdb.connect(), usingduckdb.sqllike described in https://duckdb.org/docs/stable/guides/python/polars#duckdb-to-polars works fineTo Reproduce
OS:
iOS
DuckDB Version:
1.4.2
DuckDB Client:
Python
Hardware:
No response
Full Name:
Denis Lusson
Affiliation:
Corvic AI
Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?
Did you include all code required to reproduce the issue?
Did you include all relevant data sets for reproducing the issue?
Not applicable - the reproduction does not require a data set