-
Notifications
You must be signed in to change notification settings - Fork 486
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
ref(client): Improve get_integration
typing
#3550
base: master
Are you sure you want to change the base?
Conversation
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.
Nice, LGTM as is, but mypy is complaining so this will probably need additional changes, would prefer to review once it's ready :)
@sentrivana yep still working on fixing mypy, will mark as draft until this is ready to be reviewed. I think the cleanest solution will be to replace We can still use |
6844797
to
b3678cb
Compare
Improve `get_integration` typing to make it clear that we return an `Optional[Integration]`. Further, add overloads to specify that when called with some integration type `I` (i.e. `I` is a subclass of `Integration`), then `get_integration` guarantees a return value of `Optional[I]`. These changes should enhance type safety by explicitly guaranteeing the existing behavior of `get_integration`.
b3678cb
to
d0fa5d5
Compare
The |
Improve
get_integration
typing to make it clear that we return anOptional[Integration]
. Further, add overloads to specify that when called with some integration typeI
(i.e.I
is a subclass ofIntegration
), thenget_integration
guarantees a return value ofOptional[I]
.These changes should enhance type safety by explicitly guaranteeing the existing behavior of
get_integration
.