Skip to content

max()/min() crash instead of raising the documented error#62

Merged
roed314 merged 1 commit into
roed314:masterfrom
roed-math:fix/maxmin-empty
Jul 20, 2026
Merged

max()/min() crash instead of raising the documented error#62
roed314 merged 1 commit into
roed314:masterfrom
roed-math:fix/maxmin-empty

Conversation

@roed-math

Copy link
Copy Markdown

max() and min() on a table (or constraint) with no non-null values raised TypeError: 'NoneType' object is not subscriptable from fetchone() on an empty cursor. Their docstrings promise an error, so this replaces the accident with a deliberate ValueError("no non-null values of %s in %s"); _slow_statistic gains the missing empty-cursor guards. If None is preferred over an exception, say so — it is a three-line change — but the docstring won the tie here.


Split out of #60 (one PR per issue). This branch carries only this issue's fix and its tests; the rest of the known-bug inventory stays xfailed, so the full suite is green here and the strict markers guarantee no cross-issue leakage.

max() and min() on a table (or constraint) with no non-null values raised TypeError: 'NoneType' object is not subscriptable from fetchone() on an empty cursor. Their docstrings promise an error, so this replaces the accident with a deliberate ValueError("no non-null values of %s in %s"); _slow_statistic gains the missing empty-cursor guards. If None is preferred over an exception, say so — it is a three-line change — but the docstring won the tie here.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@roed314
roed314 merged commit 3489da4 into roed314:master Jul 20, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants