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
cowork-bot: fix mixed-type column inference to produce valid SQL
A column whose values mix a string with a numeric/boolean type was either
kept at the first-seen (often numeric) type or widened the wrong direction,
producing INSERT statements with a quoted string literal in a numeric column
(invalid SQL - rejected by PostgreSQL/MySQL). Mixed types now collapse to
TEXT, the only safe universal type.
A null value remains "unset" during inference, so a column that first sees
null can still upgrade to a concrete type when a non-null value arrives
(e.g. [null, 42] -> INTEGER). All-null columns default to TEXT.
- src/json2sql/dialects.py: clarify merge_type widening semantics
- src/json2sql/converter.py: treat null as unset; default all-null cols to TEXT
- tests/test_type_inference.py: regression tests for mixed-type columns
- tests/test_edge_cases.py: fix buggy assertion expecting INTEGER for a
[string, int] column (that INSERT is invalid SQL)
Co-Authored-By: cowork-bot <noreply@coding-dev-tools.local>
0 commit comments