Skip to content

[PROOF ONLY - DO NOT MERGE] Radiology scoped clientLroResult wrapper removal - #49807

Draft
Jiaqi Zhang (JiaqiZhang-Dev) wants to merge 5 commits into
Azure:mainfrom
JiaqiZhang-Dev:proof-radiology-client-lro-result
Draft

Jiaqi Zhang (JiaqiZhang-Dev) wants to merge 5 commits into
Azure:mainfrom
JiaqiZhang-Dev:proof-radiology-client-lro-result

Conversation

@JiaqiZhang-Dev

@JiaqiZhang-Dev Jiaqi Zhang (JiaqiZhang-Dev) commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

Description

PROOF ONLY - DO NOT MERGE OR RELEASE. Validates Azure/typespec-azure#5837 against Radiology Insights' actual 2024-10-01 API default, using generated public sync/async Python clients and mocked HTTP transports.

TCGC variant, same Python generator Generated LRO result
Pre-fix baseline Extracts result, but deserializes as RadiologyInsightsJob (wrong type)
PR default Complete RadiologyInsightsJob envelope
PR + Python-scoped @@clientLroResult(..., RadiologyInsightsJob.result, "python") Typed RadiologyInsightsInferenceResult, without handwritten wrappers

Normal completion preserves the released patched SDK's inference-payload contract, including typed patient results and the polling/final-GET flow. Review 15d71b4 for the focused selector/wrapper-removal commit; baseline generator modernization is separate.

Generation: all three variants ran through the real SDK emitter-package + tsp-client update workflow, using source-packed TCGC/matching Azure Core and the required source-built compiler, with unchanged Python frontend/backend. Direct and nested dependency resolution and installed package payloads were verified. This uses unreleased dependencies and a local service overlay, not ordinary released-toolchain regeneration; tsp-location.yaml still identifies the original service source. Exact pins, reproduction helper, and detailed provenance.

Shared setup, not selector effects: all variants remove three obsolete Core @useDependency lines, normalize the package display-name quoting, and retain existing enums with:

@@usage(Fhir.R4.ContactPointSystem, Usage.output, "python");
@@usage(Fhir.R4.ContactPointUse, Usage.output, "python");
@@usage(Fhir.R4.ResearchStudyStatusCodeType, Usage.output, "python");

Generator modernization requires Python >=3.10 / azure-core >=1.37.0. All 81 existing model/enum export names remain, but this is not full public-API compatibility. With polling=False and a missing result, the existing Python backend returns an empty typed model instead of the released wrapper's None; that fallback difference is not a TCGC regression. Radiology Insights is retired: this proof is offline only, not a shipping SDK update or evidence for other languages.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

Breaking-change/release-note boxes remain unchecked intentionally: this is a non-shipping proof with the limitations above.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.
python -m pytest -q sdk\healthinsights\azure-healthinsights-radiologyinsights\tests\unit\test_lro_result.py -o asyncio_default_fixture_loop_scope=function

Passed: 15 tests against source and again against the built wheel; 15 at minimum runtime dependencies; 68 variant-specific offline comparison cases. Coverage includes typed nested results, polling/final GET, callbacks, custom polling, errors, continuation, and present/missing/null no-poll results. Black, source/sample mypy, pylint, wheel/sdist builds, and APIView (Diagnostics=[]) also passed. Validation used Python 3.12.13; no live-service tests, full CI suite, or complete Python-version matrix is claimed.

Keep existing handwritten LRO wrappers for the baseline comparison. Preserve API 2024-10-01 and released enum exports with shared TypeSpec usage overlays. Adopt generated packaging minimums (Python 3.10, azure-core 1.37.0); preserve hand-maintained docs, tests and conda configuration.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Materialize actual API 2024-10-01 Python generation using the Python-scoped RadiologyInsightsJob.result selector from Azure/typespec-azure#5837. Keep normal extension hooks; generated public sync/async clients now deserialize RadiologyInsightsInferenceResult directly.

Proof only: current Python backend maps a missing result to an empty model, unlike the released wrappers' None. No production or full drop-in compatibility claim.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Apply unchanged pygen BlackScriptPlugin output (with Linux newlines) consistently to all comparison generations. Keep canonical generated lint headers rather than hand-editing code.

Remove the generated root _model_base.py made obsolete by the wrapper removal: no remaining package Python file imports it, and current generated models use _utils/model_base.py. This cleanup is separate from the scoped LRO selector delta.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session-Id: bd9eebf7-69e6-4b1c-b7c4-8fb5e224e5a4
Exercise sync and async completion, typed nested results, callbacks, custom polling, errors, no-poll missing/null boundaries, and continuation without another PUT. Use only fake credentials and mock transports; explicitly cover the Python backend's missing-result fallback.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session-Id: bd9eebf7-69e6-4b1c-b7c4-8fb5e224e5a4
Record source-SHA package pins for TCGC, Azure Core and the compiler, the shared service overlays, and a portable reproduction helper that temporarily updates/restores the actual engineering manifests. Preserve normal customization hooks and historical release notes; mark the package README proof-only and disclose runtime minimums and compatibility limits. Materialize canonical formatter headers from real generation.

All three real update variants matched the preliminary generated source. Offline source/minimum-runtime/built-wheel tests, format/type/lint, build and APIView checks passed; no retired-service calls or package publication.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session-Id: bd9eebf7-69e6-4b1c-b7c4-8fb5e224e5a4
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).
10 pipeline(s) were filtered out due to trigger conditions.
There may be pipelines that require an authorized user to comment /azp run to run.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant