fix(cli): report annotation validation errors; bump to 0.7.0#15
Merged
Conversation
`AnnotationValidationError` carries the per-row problems in its `.errors`
list, but the CLI's central error renderer only printed `error.message` — the
summary "Annotation has N validation error(s)". A user running
`samples upload-multiplexed` against a sheet the server rejects therefore saw
the count but not what was actually wrong.
`_dispatch` now passes those errors to `Output.emit_error`, which renders them
one per line in human mode and under an `errors` key in the `--json` error
document. The `{row, message}` formatting is unified into a shared
`format_issue` helper reused by the multiplexed-upload warning output.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Releases the new `samples annotation-template` and `samples upload-multiplexed` CLI commands and the annotation validation-error reporting. The bump also gives `uvx`/pip a fresh cache key so the new code is picked up rather than a cached 0.6.0 build. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mhusbynflow
commented
Jun 9, 2026
| print(f" {format_issue(detail)}", file=self.stderr) | ||
|
|
||
|
|
||
| def format_issue(issue: JsonValue) -> str: |
Collaborator
Author
There was a problem hiding this comment.
This can be a private function I'm guessing?
Collaborator
Author
There was a problem hiding this comment.
And we can move it back to _samples.py?
Comment on lines
+68
to
+82
| :param details: Per-item detail behind a summary message (e.g. the | ||
| individual annotation validation errors). Listed under ``errors`` in | ||
| ``--json`` mode and one per line in human mode. | ||
| """ | ||
| if self.json_mode: | ||
| document: dict[str, JsonValue] = {"message": message} | ||
| if status_code is not None: | ||
| document["status_code"] = int(status_code) | ||
| if details: | ||
| document["errors"] = details | ||
| print(json.dumps(document), file=self.stderr) | ||
| else: | ||
| print(f"Error: {message}", file=self.stderr) | ||
| for detail in details or []: | ||
| print(f" {format_issue(detail)}", file=self.stderr) |
Collaborator
Author
There was a problem hiding this comment.
We haven't added tests for this
Backfills the coverage flagged in review: a direct test of the `details` parameter added to `Output.emit_error` (rendered one-per-line in human mode and under an `errors` key in `--json`), and unit tests for the public `format_issue` helper including its fall-back for issue dicts without a `message` key. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
What
Follow-up to the merged Phase 5 PR (#13), containing the work that wasn't in that merge plus a version bump.
AnnotationValidationErrorcarries the per-row problems in.errors, but the CLI's central error renderer only printed the summaryerror.message("Annotation has N validation error(s)"). Runningsamples upload-multiplexedagainst a sheet the server rejects therefore showed the count but not what was wrong._dispatchnow passes.errorstoOutput.emit_error, which renders them one-per-line in human mode and under anerrorskey in the--jsonerror document. The{row, message}formatting is unified into a sharedformat_issuehelper (also used by the multiplexed-upload warnings).samples annotation-template/samples upload-multiplexedcommands and this fix. Also givesuvx/pip a fresh cache key (a cached0.6.0build was masking the fix during local testing).Verification
--json) assert the validation detail is surfaced.236 passedacrosstests/unit.0.7.0wheel and confirmed the fix is in the packagedflowbio/cli/_main.py;uvx --refresh --from . flowbio --versionnow reports0.7.0.Human-mode output now
🤖 Generated with Claude Code