Repository navigation
Conversation
The Raises section of both stream() docstrings omitted three exceptions their own call tree raises: MPTStreamingTruncatedError for a connection aborted mid-body, MPTMaxRetryError for retry exhaustion while opening the response, and TypeError for a deletion stub without a string id. Neither MPT error is caught by the mixin's except MPTHttpError guard, so both reach the caller. A consumer writing exception handling from the docstring alone would miss them — most notably the truncation error, the likeliest runtime failure of a long export — so list them ordered by where they occur on the wire. Align docs/streaming.md, whose deletion-stub section stated the id guarantee without saying that violating it raises TypeError. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
✅ Found Jira issue key in the title: MPT-24897 |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe streaming API documentation now describes retry exhaustion, truncated response bodies, invalid deletion-stub identifiers, and linear assembly of records spanning multiple body chunks. ChangesStreaming documentation
Estimated code review effort: 1 (Trivial) | ~3 minutes Merge Risk: ⚪ Minimal · up to Streaming documentation now describes existing retry, truncation, and invalid deletion-stub errors without changing runtime behavior. No merge-blocking risk is identified. 🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
Comment |
…uncation-and-retry-errors
…uncation-and-retry-errors
|



🤖 AI-generated PR — Please review carefully.
What
Fixes MPT-24897: the
Raisessection of bothstream()docstrings listed the seven streaming errors plusJSONDecodeErrorandValueError, but omitted three exceptions the same call tree raises:MPTStreamingTruncatedError— raised byraise_stream_body_errorwhen the connection aborts mid-body. This is the most likely runtime failure of a long export, anddocs/streaming.mddocuments it prominently.MPTMaxRetryError— raised byraise_stream_open_errorwhen the transparent retry budget is exhausted while the response is still being opened.TypeError— raised byDeletionStub.from_recordon the yield path when a deletion stub arrives without a stringid.Neither MPT error is intercepted by the mixin's
except MPTHttpErrorguard around the stream open:MPTStreamingTruncatedErrorextendsMPTStreamingErrorandMPTMaxRetryErrorextendsMPTErrordirectly, so both escape that guard and reach the caller. A consumer writing exception handling from the docstring alone covers the listed errors but not these three, so a mid-body connection abort escapes their handler unclassified.How
Raisessection of bothStreamingMixin.stream()andAsyncStreamingMixin.stream(), ordered by where each occurs on the wire: open-phase retry exhaustion first, mid-body truncation immediately before the end-of-bodyMPTStreamingIncompleteErrorit is easily confused with, and the stdlib errors last.client.py,streaming_response.py,DeletionStub.from_recordanddocs/streaming.md— so the same failure is described the same way wherever it appears.docs/streaming.md: the deletion-stub section stated that onlyidis guaranteed on a stub without saying what happens when that guarantee is violated, so it now notes theTypeError. The truncation and retry-exhaustion errors were already covered there, in both the error table and the timeout section, so those parts are unchanged.Documentation only — no behaviour change, no public API change.
Testing
make checkpasses (ruff format, ruff check, flake8, mypy,uv lock --check).make testpasses: 2628 tests, 99% coverage.🤖 Generated with Claude Code
StreamingMixin.stream()andAsyncStreamingMixin.stream()docstrings.MPTMaxRetryError,MPTStreamingTruncatedError, andTypeError.docs/streaming.mdfor invalid deletion stubs.