-
Notifications
You must be signed in to change notification settings - Fork 122
[Python] Update jobs code #2656
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
4587e10 to
aa3321c
Compare
aa3321c to
2ce841e
Compare
| "JobParameterDefinition", | ||
| "JobParameterDefinitionDict", | ||
| "JobParameterDefinitionParam", | ||
| "JobPermission", |
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.
From your summary:
Rename jobs.Permission into jobs.JobPermission to avoid confusion, following the spec.
I don't fully understand the mechanics here yet, how is this generated? And is there a README covering that for maintainers somewhere?
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.
JobPermission is fixed in #2642, I've just generated the code using effective jsonschema
| ) | ||
|
|
||
| if TYPE_CHECKING: | ||
| from typing_extensions import Self |
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.
Btw, tangential question, what error do we show for Python <3.11, where things like these extensions are not available?
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.
This branch will be only evaluated by tools like pyright/mypy that comes with typing_extensions. We could have added typing_extensions as a dependency, but we don't need it during runtime.
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.
That's fine, this is just a tangential question, but I'm still interested in the answer — what happens if you try to use jobs as code with Python <3.11?
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 works, our acceptance tests run with Python 3.10
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.
discussed offline: there's metadata preventing installation for <3.10
lennartkats-db
left a comment
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.
This looks good, but please follow up with READMEs or maintainers!
pietern
left a comment
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.
|
@pietern There is no strong dependency, code generator special-cased JobPermission. To remove special-casing we should update JSON schema |
|
@kanterov But this change doesn't touch the codegen? |
|
@pietern because the PR with codegen is still being reviewed |
Changes
Update Python code from the latest json schema.
Rename
jobs.Permissionintojobs.JobPermissionto avoid confusion, following the spec.Annotate features in a preview with "EXPERIMENTAL" and exclude them from the documentation.