cowork-bot: automated improvements (cowork/improve-json2sql-2)#37
Merged
Conversation
…ly roots Type inference now collapses a column whose values mix incompatible types (e.g. a string and an integer) to TEXT instead of keeping the first-seen numeric type. Previously this produced INSERT statements with a quoted string literal in a numeric column, which Postgres/MySQL reject as invalid SQL. A NULL value is treated as "unset" so a column that first sees NULL can still take a concrete type when a non-NULL value arrives (e.g. [null, 42] -> INTEGER), and an all-NULL column resolves to TEXT. convert()/generate_schema() no longer emit an invalid `CREATE TABLE "x" ();` or `INSERT INTO "x" () VALUES ();` for an empty object or a root whose only content is nested arrays (flatten). They now emit only the valid child tables, or an explicit comment when nothing can be generated, instead of a silent green no-op. - src/json2sql/converter.py: add _infer_type/_merge_type; skip empty root tables - tests/test_edge_cases.py: correct the two tests that encoded the old buggy widening behavior - tests/test_type_inference.py: regression tests for mixed-type, NULL, and empty/nested-only-root cases across all three dialects - .github/workflows/cowork-auto-pr.yml: seed server-side PR opener
The Homebrew formula is json2sql-cli.rb and the Scoop manifest name is json2sql-cli, so 'brew install json2sql' and 'scoop install json2sql' fail. Updated both to 'json2sql-cli' to match the actual package names in homebrew-tap/Formula/json2sql-cli.rb and scoop-bucket/bucket/json2sql-cli.json. Revenue lever: bottom-of-funnel — broken install commands in the README block macOS/Linux/Windows users from installing json2sql. NOT pushed (W's call).
…ess PYTHONPATH in test_remaining_coverage — resolves collection error and subprocess import failure
Contributor
Author
🤖 Automated Code Review✅ Ruff Lint — No issues
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated improvement PR from the Cowork repo-improver rotation (one coherent senior-dev improvement per run; see individual commit messages). Subsequent runs push additional commits to this PR rather than opening new ones.