-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[python-jenkins] Improve get_jobs and get_all_jobs return type #14547
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
@@ -1,7 +1,7 @@ | |||
from _typeshed import Incomplete | |||
from collections.abc import Mapping, MutableMapping, Sequence | |||
from re import Pattern | |||
from typing import Any, Final, Literal, overload | |||
from typing import Any, Final, Literal, TypedDict, overload |
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.
see above
from typing import Any, Final, Literal, TypedDict, overload | |
from typing import Any, Final, Literal, TypedDict, overload, type_check_only |
844784f
to
3c985d7
Compare
_class: str | ||
url: str | ||
color: str | ||
name: str |
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.
Also fullname
attribute was missing, moreover it seems required like name
but I can't say for sure that it is required :)
name: str | |
name: Required[str] | |
fullname: Required[str] |
As a quick note, squash commits aren’t the recommended approach. |
This comment has been minimized.
This comment has been minimized.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
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.
Thanks! Looks good, just one remark about the TypedDict keys
url: str | ||
color: str |
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.
Considering the docs say
Each job is a dictionary with ‘name’, ‘url’, ‘color’ and ‘fullname’ keys.
I think url
and color
can be made required as well?
Fixes #14538