Repository navigation
fix: refuse invalid --min-rows and --max-change in check - #138
Conversation
laaielichter
left a comment
There was a problem hiding this comment.
Thank you @rohangoud17, and thanks for following the pointer to parse_spec. #106 is yours (you asked on 2026-11-09 at 19:07 and were assigned the next morning), and the code does what the issue asks. One small CHANGELOG fix and it is ready.
What I checked. I merged 60df34a onto current main (c48adf8) in a scratch worktree: clean merge, ruff check . passes, pytest -q gives 883 passed, 10 skipped. Against #106's "Done when":
- By hand through the CLI on the demo database:
--min-rows -5,--max-change -5,--max-change nanand--max-change infeach returnstatus: "error"with a message naming the option, exit code 1, and no query runs.--min-rows 0and--max-change 0stay valid (exit 0). - Tests exist through
parse_specand throughmain([...]), for every refused value, plus the two zero cases. - The diff only touches
checks.py, two test files and the CHANGELOG, so nothing outside the scope, and no change to how SQL is built or run.
Please fix: the CHANGELOG line.
- Typo: "NaN orinfinite" should be "NaN or infinite".
- The new bullet is at the top of
### Fixed. Other open PRs add theirs there too, so they would all conflict. Please move it to the end of the existing### Fixedlist (just above### Changed), then push.
CI: both runs for this commit (ci, codeql) are action_required, which is GitHub holding a first-time contributor's run until a maintainer approves it, so no check has run yet.
Heads-up: other open PRs also add tests at the end of tests/test_cli_and_mcp.py; if that conflicts later, merge main and keep both blocks.
Generated by Claude Code
Updated changelog with recent fixes, changes, and acknowledgments.
|
Fixed the changelog typo, moved the entry to the end of ### Fixed, and merged main to resolve the conflict in tests/test_cli_and_mcp.py (kept both test blocks). pytest and ruff check . pass locally. Ready for another look |
laaielichter
left a comment
There was a problem hiding this comment.
Thank you @rohangoud17 for the quick update: the typo is fixed, the conflict is resolved with both test blocks kept, and the code is unchanged from what I already checked. One thing is left, and it comes from the 0.4.0 release that landed in between.
What I checked. I merged 28a0af8 onto current main (2bdae73; main is already an ancestor, so it is a clean merge) in a scratch worktree on Python 3.13 / Linux: ruff check . passes and pytest -q gives 895 passed, 10 skipped. The diff is still only checks.py, two test files and the CHANGELOG, and the #106 "Done when" list is still met (negative --min-rows, negative / NaN / infinite --max-change refused with exit 1; 0 stays valid).
Please fix: the CHANGELOG line is inside the released 0.4.0 section. Main now has ## 0.4.0 - 2026-11-11, and your bullet sits at the end of that section's ### Fixed list (around line 61), so it would be reported as shipped in 0.4.0 when it was not. New entries go under a new ## Unreleased heading above ## 0.4.0:
# Changelog
## Unreleased
### Fixed
- `check` now refuses a negative `--min-rows` and a negative, NaN or infinite `--max-change` instead of silently passing or failing (#106).
## 0.4.0 - 2026-11-11
Then remove the line from the 0.4.0 list. If another PR has already added ## Unreleased by the time you push, merge main and just add your bullet at the end of its ### Fixed list.
One tiny thing while you are there: git diff --check flags a blank line at the end of tests/test_cli_and_mcp.py (line 175); please drop it.
CI: the ci and codeql runs for this head are action_required, so GitHub is still waiting for a maintainer to approve them; no check has run on GitHub yet. That is not a failure on your side.
Generated by Claude Code
|
Thanks for catching that! I moved the entry to a new ## Unreleased section above 0.4.0, removed it from the 0.4.0 ### Fixed list, and dropped the trailing blank line in tests/test_cli_and_mcp.py. git diff --check is clean, and pytest and ruff check . pass locally. |
laaielichter
left a comment
There was a problem hiding this comment.
Thank you, @rohangoud17: both things I asked for are done, and quickly. The entry now sits under a new ## Unreleased / ### Fixed above ## 0.4.0, it is gone from the 0.4.0 list, and the trailing blank line in tests/test_cli_and_mcp.py is dropped. This is approved from my side.
What I checked on head 0934626:
- Delta since
28a0af8: onlyCHANGELOG.md(the bullet moved as asked, wording unchanged) and the one removed blank line intests/test_cli_and_mcp.py. The code inchecks.pyis the same I already reviewed. Scope is still four files (checks.py, two test files, CHANGELOG), nothing touches how SQL is built or run. - Merged onto current
main(2bdae73, which is the base of your branch, so a clean fast-forward) in a scratch worktree with a fresh venv on Python 3.13 / Linux:ruff check .passes,pytest -qgives 895 passed, 10 skipped, andgit diff --checkis clean. - By hand through the CLI on a small DuckDB table:
--min-rows -5,--max-change -5,--max-change nanand--max-change infeach returnstatus: "error"with a message naming the option and exit code 1;--min-rows 0and--max-change 0still returnok(exit 0).
CI: the ci and codeql runs for this head are action_required (GitHub holds a first-time contributor's run until a maintainer approves it), so no check has run on GitHub yet. This repository requires 11 checks, so I am not merging this myself; it waits for the maintainer to approve the runs and for them to go green.
Thanks again for sticking with it through the review rounds.
Generated by Claude Code
|
@rohangoud17 a heads-up: #147 landed today and added its line to Generated by Claude Code |
|
Merged main and kept both lines, with mine at the end of ### Fixed. Only
CHANGELOG.md changed. Thanks for the heads-up!
…On Fri, 13 Nov 2026 at 22:46, laaielichter ***@***.***> wrote:
*laaielichter* left a comment (laaielichter/Gulliver#138)
<#138 (comment)>
@rohangoud17 <https://github.com/rohangoud17> a heads-up: #147
<#147> landed today and
added its line to ## Unreleased / ### Fixed in CHANGELOG.md, right where
this PR adds its own, so this PR now conflicts with main in that file
only. Could you merge main into your branch and keep both lines, yours at
the end of the ### Fixed list? The code stays approved. CI can only run
once the conflict is gone, and its runs then wait for the maintainer's
approval.
------------------------------
*Generated by Claude Code <https://claude.ai/code>*
—
Reply to this email directly, view it on GitHub
<#138?email_source=notifications&email_token=BD2XUBQCFAMKLWV37UEXSDD5Y7ISNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBXGEZDAMJTHEY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLDGN5XXIZLSL5RWY2LDNM#issuecomment-6871201391>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BD2XUBU65PBORSMULPEQZR35Y7ISNAVCNFSNUABGKJSXA33TNF2G64TZHMYTINBSGA2TCMRYHE5US43TOVSTWNRTGE2DQOBSGI3DFILWAI>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/BD2XUBWK23T6A6BTGNYFIML5Y7ISNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBXGEZDAMJTHEY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJKTGN5XXIZLSL5UW64Y>
and Android
<https://github.com/notifications/mobile/android/BD2XUBV7JJATKAABUTGQ3ST5Y7ISNA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTMOBXGEZDAMJTHEY2M4TFMFZW63VHNVSW45DJN5XKKZLWMVXHJLTGN5XXIZLSL5QW4ZDSN5UWI>.
Download it today!
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
|
Thank you @rohangoud17 for merging main. Re-checked: only CHANGELOG changed since approval (head Generated by Claude Code |
laaielichter
left a comment
There was a problem hiding this comment.
Thank you @rohangoud17 for merging main in. Still approved on d7235a1.
Compared with 0934626, which I approved, the only change is the merge of current main (52666d3); checks.py, the tests and your CHANGELOG line are the same, and the merge is clean. With this head: ruff check . passes, git diff --check is clean and pytest -q gives 888 passed, 10 skipped.
CI: the ci and codeql runs for this head are action_required until a maintainer approves them, and Gulliver needs all 14 checks green, so I am not merging yet.
Generated by Claude Code
|
@rohangoud17 a heads-up: other PRs landed on Generated by Claude Code |
|
Good news for part of the conflict: the CHANGELOG part got easier. We changed the rule so contributors don't edit CHANGELOG.md any more; we add your entry with credit when we merge. When you merge main, just take main's version of CHANGELOG.md (or drop your change to it). The conflict in Generated by Claude Code |
|
Thanks @rohangoud17, the
Once both are pushed, the CI runs wait for a maintainer approval again, and we will review the new head. Generated by Claude Code |
|
Merged main: took main’s CHANGELOG and kept both test blocks in tests/test_cli_and_mcp.py. Thanks! |
|
Thanks @rohangoud17. The two stray lines are gone, and the code works. I merged current One thing is left: the branch still adds a line to After that, Optional, not required for this PR: since #174, When you push, the CI runs will need maintainer approval again. I'll approve them once I've checked the new head. Generated by Claude Code |
laaielichter
left a comment
There was a problem hiding this comment.
Thanks @rohangoud17. I reproduced #106 on main: check events --min-rows -5 and --max-change nan both get as far as the query. On this branch both are refused with exit 1 and a message that names the option, and --min-rows 0 still works. The head passes the suite on its own (1149 passed after merging main, ruff clean).
Before it can merge:
- Remove the CHANGELOG.md line. The maintainer writes that entry (as we asked earlier on this PR).
- The PR is blocked: the CI workflows have not run on this head yet. Once they are green, it can go.
Welcome to Gulliver! CONTRIBUTING.md has the setup steps (pip install -e ".[dev]", pytest, ruff check .). A free next issue is #120 (check --not-null "" passes with nothing checked), labeled good first issue.
If Gulliver is useful to you, a ⭐ helps other people find it.
Generated by Claude Code
|
Thanks for the review and the welcome! Removed the CHANGELOG.md line; the PR now only touches checks.py and the tests. |
|
Thanks @rohangoud17. The Generated by Claude Code |
docs(changelog): credit @rohangoud17 (#106, #138)
Fixes #106
What and why
checkaccepted a negative--min-rowsand a negative, NaN or infinite--max-change, so the check silently always passed or always failed. These are now refused the same way--rangerefuses bad bounds (#74).parse_spec, raising aValueErrorin_range_bound's message style.features.checkturns it intostatus: "error"(exit 1), so the CLI and the Python function are both covered.nan < 0isFalse.--min-rows 0and--max-change 0stay valid.How it was tested
pytestpasses (864 passed, 11 Postgres skipped, on Windows)ruff check .passesNew tests:
parse_specrejects each invalid value and still accepts 0;main([...])exits 1 with a message naming the option, and--min-rows 0exits 0. Changelog entry added under Unreleased.