agnes-the-ai-analyst/cli
ZdenekSrotyr 751cc25327
release: 0.46.5 — agnes describe -n parses, server sanitizes NaN (#224)
## Summary

Two bugs in `agnes describe` surfaced from a real analyst session following the CLAUDE.md agent-rails discovery workflow. Together they break `agnes describe` end-to-end for any analyst (or analyst-AI) who follows the documented form.

### A) CLI parsing

`agnes describe TABLE -n 5` failed with `Missing argument 'TABLE_ID'`. Root cause: the command was registered as a `Typer.Typer` subcommand group via `app.add_typer(describe_app, name="describe")` + `@describe_app.callback(invoke_without_command=True)`, and that pattern mis-parses positional + short-int option in some orderings. Same pattern in `cli/commands/schema.py` works only because schema has no INTEGER short option. Fix: switch to flat `@app.command("describe")`.

### B) Server NaN

`/api/v2/sample/<id>` (called by `agnes describe`) returned HTTP 500 with `ValueError: Out of range float values are not JSON compliant: nan` whenever a row contained NaN. Fix: sanitize NaN/±inf to None before JSON serialization.

## Test plan

- [x] `pytest tests/test_cli_describe*.py` — added regression tests pinning `-n` parsing on either side of the positional.
- [x] `pytest tests/test_api_v2_sample*.py` — added regression test for NaN row → JSON `null` (not 500).
<!-- devin-review-badge-begin -->

---

<a href="https://app.devin.ai/review/keboola/agnes-the-ai-analyst/pull/224" target="_blank">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://static.devin.ai/assets/gh-open-in-devin-review-dark.svg?v=1">
    <img src="https://static.devin.ai/assets/gh-open-in-devin-review-light.svg?v=1" alt="Open in Devin Review">
  </picture>
</a>
<!-- devin-review-badge-end -->
2026-05-07 18:16:21 +02:00
..
commands release: 0.46.5 — agnes describe -n parses, server sanitizes NaN (#224) 2026-05-07 18:16:21 +02:00
lib release: 0.46.4 — detach SessionEnd push so it survives claude -p SIGTERM (#222) 2026-05-07 17:59:27 +02:00
skills chore(docs): replace stale da verbs and vendor-specific install paths 2026-05-04 21:22:19 +02:00
__init__.py feat: add Docker, CLI tool, scheduler, and agent skills 2026-03-27 15:30:03 +01:00
client.py release: 0.45.0 — easy-wins bundle (#84 #164 #177 #178 #203 #204) 2026-05-07 11:43:16 +02:00
config.py fix(devin-review): stale-token override + status sessions counter + lock comment 2026-05-04 21:26:30 +02:00
error_render.py chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
main.py release: 0.46.5 — agnes describe -n parses, server sanitizes NaN (#224) 2026-05-07 18:16:21 +02:00
snapshot_meta.py chore(cli-rename): replace stale da verbs in active code paths 2026-05-04 21:10:43 +02:00
update_check.py chore: rename stale 'da' references to 'agnes' + CHANGELOG 2026-05-06 23:23:59 +02:00
v2_client.py feat(store): bundle export/import + agnes store update + agnes admin store push 2026-05-05 11:51:31 +02:00