Repository navigation
fix(http-client-python): prevent Pylint statement-limit errors for SSE operations - #12281
Conversation
… streams Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
|
All changed packages have been documented.
Show changes
|
There was a problem hiding this comment.
🟡 Changes recommended
Short operations can produce unused-suppression diagnostics, and the isolated unit-test environment lacks Pylint.
2 open findings
What changed in this PR
Updates the Python client generator to suppress statement-limit warnings for structured-stream implementations without changing runtime behavior.
Changes:
- Adds method-scoped suppression, excluding overload declarations.
- Adds sync/async regression coverage and a Chronus fix entry.
| File | Description |
|---|---|
packages/http-client-python/tests/unit/test_structured_stream_pylint.py |
Tests suppression scope and generated SSE lint results. |
packages/http-client-python/generator/pygen/codegen/models/operation.py |
Adds structured-stream statement-limit suppression. |
.chronus/changes/http-client-python-sse-pylint-2026-10-14.md |
Documents the generator fix. |
🧠 Review effort: Balanced
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Python emitter diffBaseline Diff summary: 28 file(s), +156 / -84 Rendered diff: inline on the run summary, or the emitter-diff-html artifact. Informational check (eng/emitter-diff); does not block the PR. |
|
You can try these changes here
|

Summary
Search SDK regeneration reported Pylint
too-many-statements (54/50)on both synchronous and asynchronousretrieve_streamimplementations.too-many-statementssuppression for non-overload structured-stream implementations, following existing generator conventions.@typespec/http-client-python.The separate Search wrapper typed-event/bytes incompatibility is not included.
Validation
npm run buildpassed.npm run formatandnpm run lint -- --emitterpassed.pnpm formatpassed.54/50statements (65/50with reconnect) when the directive is removed; generated output passes the statement-limit check with the fix.Actual downstream Search regeneration
Regenerated
azure-search-documentsfrom committed SDK snapshotcb86c24d343eb1eee5c86d39c4b135eebe6bf110, preserving spec pinc195a3fe73b28cd90bf8a302944b2c0ec3d80defand API version2026-08-01-preview. Used wrapper@azure-tools/typespec-python0.63.10, this PR's locally packed@typespec/http-client-python0.39.0, compiler 1.17.0, and TCGC 0.73.0 with native generation throughtsp-client0.33.1. All 15 handwritten patch files remained unchanged; existing generation workarounds were reapplied.54/50, with no other full-package Pylint failures.TypeError: can't concat KnowledgeBaseRetrievalStartedEvent to bytes. No wrapper or test changes were made. This confirms the lint fix, not full Search runtime compatibility.Dependencies were restored exclusively through CFS without manifest or lockfile changes; no Pyodide fallback was used. The tarball source, installed npm source, bundled generator wheel, and freshly reinstalled generator source were verified identical for
operation.py. Validated emitter artifact SHA256:b2091bcb9c52de989d118e4569afd666e777a27535266bf69db765311143bf3c.