[Python] Handle deprecation and private annotations in codegen#2773
Merged
[Python] Handle deprecation and private annotations in codegen#2773
Conversation
827649e to
37cc417
Compare
pietern
reviewed
Apr 29, 2025
| # TODO remove as a follow-up | ||
| "jobs.Task": { | ||
| "dashboard_task", | ||
| "power_bi_task", |
Collaborator
Author
There was a problem hiding this comment.
It's mostly to reduce the diff because these fields were never there
Collaborator
Author
There was a problem hiding this comment.
Can add them once we merge this PR, or can change this PR
Contributor
There was a problem hiding this comment.
Separately is fine, keeps this one focused.
The comment didn't suggest diff minimization, hence the question.
|
|
||
|
|
||
| @dataclass(kw_only=True) | ||
| class Permission: |
Collaborator
Author
There was a problem hiding this comment.
It was a leftover because we didn't clean output folder when re-generating, it was never exported
pietern
approved these changes
Apr 29, 2025
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.
Changes
Handle deprecated and private annotations in codegen.
There is a trick to transitively mark fields as deprecated (private) because it's normal for JSON schema to only mark fields as deprecated (private) and not put the deprecated (private) annotation into referenced schemas.
Why
With that, we can continuously check that the Python code is consistent with the latest JSON schema.