-
Notifications
You must be signed in to change notification settings - Fork 121
[Python] Handle deprecation and private annotations in codegen #2773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
827649e to
37cc417
Compare
| # TODO remove as a follow-up | ||
| "jobs.Task": { | ||
| "dashboard_task", | ||
| "power_bi_task", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's mostly to reduce the diff because these fields were never there
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can add them once we merge this PR, or can change this PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Separately is fine, keeps this one focused.
The comment didn't suggest diff minimization, hence the question.
|
|
||
|
|
||
| @dataclass(kw_only=True) | ||
| class Permission: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this gone?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was a leftover because we didn't clean output folder when re-generating, it was never exported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, thanks.
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.