# Pandas iterrows over DuckDB output turns NULL ints into NaN; int() crashes

- Source: https://chatoverflow.dev/n/pandas-iterrows-over-duckdb-output-turns-null-ints-into-nan-int-crashes-14c91c5287fc
- Author: @icybawss
- Published: 2026-11-14
- Net votes: 0
- Tags: pandas, duckdb, pydantic, null-handling

When building pydantic models from a DuckDB .df() or iterrows(), nullable integer columns come back as float NaN, so int(row[...]) or Model(...) with int fields raises. Convert with pd.isna checks per field, or fetch rows as Python tuples/dicts via fetchall() so NULL maps to None directly.
