Repository navigation
fix: support builtin generic binding annotations in worker runtimes - #1952
Draft
hallvictoria wants to merge 4 commits into
Draft
hallvictoria wants to merge 4 commits into
hallvictoria wants to merge 4 commits into
Conversation
This branch has not been deployed
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.
Description
Companion worker/runtime change for Azure/azure-functions-python-library#378.
The SDK can validate PEP 585 binding annotations, but registration currently rejects builtin aliases such as
list[EventHubEvent]and the innerlist[str]inOut[list[str]]before reaching the SDK converter. Explicit output return annotations have a separate class-only gate.Changes
typing.get_origin()/typing.get_args()in the legacy worker and both runtime libraries.ParamTypeInfo.Outas return annotations.Release dependency / why draft
SDK dependency rollout is outstanding. End-to-end tests used the SDK wheel built from PR378 commit
10b47abe2b4ebd3ba7d607ecb5b5f2e59a89d26a. This PR does not invent an unreleased SDK version or change dependency pins prematurely. Full builtin-alias support requires a compatible SDK release and subsequent dependency updates. Supporting the older Python worker routes also needs the corresponding SDK 1.x changes/release. The three unused vendored typing-inspection modules and their dedicated tests have been removed, along with the empty legacy helper package and stale lint/type-check/coverage exclusions. Frozen dependency-isolation SDK fixtures retain their own required helper copies.Validation
New regression tests
Python 3.13.17, Windows:
AZURE_FUNCTIONS_TEST_LEGACY_REGISTRY=1.git diff --checkpasses. This is not a claim that the repository's existing docstring-plugin diagnostics are clean.Core Tools: V2 only, Python 3.13.17
Core Tools 4.16.0, host 4.1054.250.26428, packaged candidate V2 runtime wheel 1.3.0, fixed SDK wheel from PR378, local Azurite. Neither the installed Core Tools worker files nor runtime modules were patched in place.
16/16 scenarios passed:
List[EventHubEvent],list[EventHubEvent],collections.abc.Sequence[EventHubEvent], list with union elementOutwith typing List, builtin list, ABC Sequence, union elements, optional elements['first', 'second']; empty batch produces no messages.Out[list[int]]; HTTPlist[str]FunctionLoadErrorduring indexing, not leaked TypeError/AttributeError.Every case verifies the actual imported runtime/SDK file paths and SHA-256 hashes against the built wheels; runtime files are also checked against source. This prevents accidentally validating Core Tools' bundled runtime or a different SDK. Negative cases persist import provenance before indexing fails. Each host process is stopped after its case; the owned Azurite process was stopped afterward.
A/B comparison against unchanged worker commit
678215635302fae450917562f3442b9c65678627, with the same fixed SDK:Vendored-helper cleanup validation (141bea8)
git diff --checkpasses.Existing V2 unit suite limitations
The available existing V2 unit suite produced 184 passed, 2 skipped, 16 subtests passed, and 8 failed, identically on baseline and candidate. Exact failing test sets were compared and match:
time.tzsetunavailable on Windows).The optional deferred-binding test module could not be collected because the configured package proxy returned 404 for
azurefunctions-extensions-bindings-eventhub==1.0.0b1; direct PyPI download also failed TLS negotiation. It was excluded from the comparable existing-suite runs. The existing code-quality test was checked separately as noted above. This is not a full green unit-suite claim. No Azure resources were deployed.Pull Request Checklist
Host-Worker Contract
Worker Execution Logic
Python Version Coverage
Programming Model Compatibility (proxy_worker and r2p2)