pythonduckdb

How to increase row output limit in DuckDB in Python?


I'm working with DuckDB in Python (in a Jupyter Notebook). How can I force DuckDB to print all rows in the output rather than truncating rows? I've already increased output limits in the Jupyter Notebook.

This would be the equivalent of setting .maxrows in the CLI, but I can't find how to do this in Python.


Solution

  • There is not currently a way to increase that maxrows parameter in Python. I would recommend outputting your data as a Pandas or Arrow dataframe and using the flags that those libraries support to decide what is shown.

    Ex:

    my_df = duckdb.sql("select 42").df()