Skip to content

cowork-bot: automated improvements (cowork/improve-json2sql-2)#37

Merged
Coding-Dev-Tools merged 8 commits into
mainfrom
cowork/improve-json2sql-2
Jul 21, 2026
Merged

cowork-bot: automated improvements (cowork/improve-json2sql-2)#37
Coding-Dev-Tools merged 8 commits into
mainfrom
cowork/improve-json2sql-2

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

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.

…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
@github-actions

Copy link
Copy Markdown
Contributor Author

🤖 Automated Code Review

✅ Ruff Lint — No issues

⚠️ Ruff Format — Formatting needed

Would reformat: conftest.py
Would reformat: src/json2sql/cli.py
Would reformat: src/json2sql/converter.py
Would reformat: tests/test_cli.py
Would reformat: tests/test_remaining_coverage.py
Would reformat: tests/test_type_inference.py
6 files would be reformatted, 7 files already formatted

✅ Secret Detection — Clean

✅ Large Files — Within limits

📊 Diff Stats — 6 file(s) changed

 .github/workflows/ci.yml         |    4 +-
 .github/workflows/publish.yml    |    2 +-
 README.md                        |    4 +-
 conftest.py                      |   19 +
 package-lock.json                | 1106 ++++++++++++++++++++++++++++++++++++++
 tests/test_remaining_coverage.py |    8 +
 6 files changed, 1138 insertions(+), 5 deletions(-)

Verdict: ⚠️ Warnings — Lint/format issues found. Recommend fixing before merge.

Automated by Coding-Dev-Tools/.github reusable workflow.

@Coding-Dev-Tools
Coding-Dev-Tools merged commit 94ee7aa into main Jul 21, 2026
7 checks passed
@Coding-Dev-Tools
Coding-Dev-Tools deleted the cowork/improve-json2sql-2 branch July 21, 2026 21:13
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.

1 participant