Conversation
… errors
The annotation endpoint returns validation errors in a different format
({"validation": [...]}) than the standard {"error": ...} response.
A dedicated exception preserves the structured error list so callers can
inspect individual validation failures.
FLOW-547
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Change _raise_for_error fallback from "Unknown error" to the full body
dict when the response has no "error" key. This preserves structured
annotation validation data ({"validation": [...]}) in the exception.
Also replace magic HTTP status code numbers with HTTPStatus constants
in _transport.py and exceptions.py.
FLOW-547
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Generalize the chunked upload method so it can be reused for multiplexed and annotation uploads. The method now takes an endpoint and a static extra_fields dict instead of sample-specific parameters. is_last_sample is now sent as a static per-file flag rather than being computed per-chunk, relying on the API's updated finalization logic (is_last_sample AND data.is_ready). FLOW-547 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Upload multiplexed reads and an annotation sheet in a single call. The annotation is uploaded first so reads files are not uploaded if the annotation is invalid. - Annotation hard validation errors raise AnnotationValidationError - Annotation warnings are auto-accepted by default (ignore_warnings=True) and included in the result for inspection - Set ignore_warnings=False to raise AnnotationValidationError on warnings - Supports single-end and paired-end reads with chunked uploads FLOW-547 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
@claude please review this PR |
|
Claude finished @mhusbynflow's task in 1m 42s —— View job PR Review: Multiplex UploadTodo:
SummaryThis PR adds Issues1. Docstring incorrect:
|
- Fix docstring: `ignore_warnings=False` raises `AnnotationValidationError`, not `BadRequestError` - Open file once before chunk loop instead of reopening per chunk - Fix `form_data` type annotation to `str | bool | list[str] | None` - Add comment clarifying `expected_file_size` is a byte offset
|
@claude changes should have been addressed. Please check |
|
Claude finished @mhusbynflow's task in 48s —— View job Review of Addressed FeedbackTodo:
Issues #2, #3, and #4 are fully resolved. Issue #1 is partially fixed — one spot still has the wrong exception class. Remaining Issue#1 (partial fix):
|
| # | Issue | Status |
|---|---|---|
| #2 | expected_file_size misleading — added clarifying comment |
✅ Fixed |
| #3 | File reopened per chunk — now opened once before loop | ✅ Fixed |
| #4 | form_data annotation was dict[str, str] — now dict[str, str | bool | list[str] | None] |
✅ Fixed |
| #1 | :raises lines corrected to AnnotationValidationError |
✅ Fixed (partial) |
One small fix remaining on the ignore_warnings param description.
No description provided.