-
Notifications
You must be signed in to change notification settings - Fork 801
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
Add typing to Histogram/Summary/Gauge #759
Add typing to Histogram/Summary/Gauge #759
Conversation
Also we could set disallow_incomplete_defs to True Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
3c515e7
to
a34a80f
Compare
@@ -413,7 +413,7 @@ def set_function(self, f): | |||
|
|||
self._raise_if_not_observable() | |||
|
|||
def samples(self) -> Iterable[Sample]: | |||
def samples(_: Gauge) -> Iterable[Sample]: |
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 is the only one thing which is needed to enable disallow_incomplete_defs
.
Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
6b21fbd
to
76c0c48
Compare
return (Sample('', {}, float(f()), None, None),) | ||
|
||
self._child_samples = types.MethodType(samples, self) | ||
self._child_samples = types.MethodType(samples, self) # type: ignore |
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.
mypy
is not fond of such an overwrite of a method
@csmarchbanks Could you look on it please? Many thanks. |
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, this is great!
I will take a closer look next week, but generally this is looking good to me.
Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
4ad168e
to
0551300
Compare
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.
One small comment, otherwise I think this looks good!
32535ef
to
3d4a632
Compare
Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
3d4a632
to
02b0053
Compare
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.
Awesome, thanks!
Hi,
It is a small addition to Histogram/Summary/Gauge typings.
PS I suppose at the current stage it is fine to set disallow_incomplete_defs to True.