You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Enh](discussion): float // 0.0 returns null on every backend except Polars, which one is intended? #4070
The null mostly comes from narwhals here. pandas and pyarrow return inf, -inf and NaN natively, and narwhals masks them in floordiv_null_on_zero and floordiv_compat. The pyarrow one says the mask is there to match Polars, but Polars only returns null for integer division by zero.
DuckDB here is the exception, it returns null on its own.
Which would be better? I'd say to follow Polars, which is what pandas and pyarrow do natively, and which narwhals does for / on floats already. But if keeping null everywhere is easier for the SQL backends, I think that we should document that as a known difference from Polars.
changed the title [-][Enh](discussion): float '// 0.0' returns null on every backend except Polars, which one is intended?[/-][+][Enh](discussion): float `// 0.0` returns null on every backend except Polars, which one is intended?[/+]on Oct 13, 2026
Activity
[-][Enh](discussion): float '// 0.0' returns null on every backend except Polars, which one is intended?[/-][+][Enh](discussion): float `// 0.0` returns null on every backend except Polars, which one is intended?[/+]