Repository navigation
fix: match generated Python stubs to effective method bindings - #2819
Draft
Rana Singh (ranadeepsingh) wants to merge 1 commit into
Draft
Rana Singh (ranadeepsingh) wants to merge 1 commit into
Rana Singh (ranadeepsingh) wants to merge 1 commit into
Conversation
Summary: - Keep the effective final unconditional method binding when generating supported stubs. - Normalize identifier identity with Python's NFKC rules for service-alias collision checks. - Handle explicit continuations, descriptor decorators, nested scopes, async declarations, and Python indentation; retain the existing ASCII-only supported stub-signature boundary. Prompting intent: Preserve reviewed follow-up fixes after the prerequisite PRs were merged, and complete current-source validation and review. Linked sources: Follow-up to microsoft#2810 and microsoft#2805. Rationale: Generated Python stubs can retain overwritten method bindings, and service-column alias checks can miss equivalent Unicode identifiers or continued declarations. This follow-up makes supported stub extraction and collision checks match the generated Python class more closely. Local validation: sbt "set core / Test / fork := false" "core/compile" "core/Test/compile" "core/testOnly com.microsoft.azure.synapse.ml.codegen.PyCodegenSuite" "core/scalastyle" "core/Test/scalastyle" Passed: 93 tests, 0 skipped, compile/Test compile, both scalastyle gates. Publication: Explicitly authorized draft-first bootstrap; formal reviews and current-head CI remain pending. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 5ba39157-c8dd-4adb-90e0-ff963a1e6733
|
Hey Rana Singh (@ranadeepsingh) 👋! We use semantic commit messages to streamline the release process. Examples of commit messages with semantic prefixes:
To test your commit locally, please follow our guild on building from source. |
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
3 of 5 tasks
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.
Generated Python stubs can retain a method definition overwritten by a later definition, and service-column alias checks can miss equivalent Unicode identifiers or continued declarations. This follow-up corrects supported
def-based stub extraction and method-definition collision checks.Related Issues/PRs
Follow-up to #2810 and #2805.
What changes are proposed in this pull request?
defbinding when generating supported stubs.Existing scope limits: extraction tracks method definitions, not arbitrary Python class-attribute rebinding. Assignments (including
method = classmethod(method)), annotated assignments, nested classes,del, and imports can still leave stale method stubs or bypass service-alias collision checks. Those limitations exist on the target branch and are not fixed here. Generated additional methods should use explicitdefdeclarations and supported decorators rather than those rebinding forms. Quoted annotations containing=also retain the existing stub-parsing limitation.How is this patch tested?
Local validation covers the pending source corrections based on master
6c2699defcfb24d5bff5ba55f2252ba2d8cbea24. Those corrections are not yet all in the published PR head.Passed: compile, test compilation, 97/97 tests (0 skipped), production scalastyle, and test scalastyle. Run with JDK 11, Spark 3.5.0, Scala 2.12.17, Python 3.11.8, and a single test JVM.
Draft status: local regression gates passed. The six-round review process, publication and Azure/GitHub CI for the latest pending source, and remote-comment reconciliation are not yet complete. Published as a draft first with explicit approval so review evidence can use the real PR number; no readiness gate is waived.
Does this PR change any dependencies?
Does this PR add a new feature? If so, have you added samples on website?
website/docs/documentationfolder.Make sure you choose the correct class
estimators/transformersand namespace.DocTablepoints to correct API link.npm startto make sure the website renders correctly.<!--pytest-codeblocks:cont-->before each python code blocks to enable auto-tests for python samples.WebsiteSamplesTestsjob pass in the pipeline.