Add typing to Histogram/Summary/Gauge#759
Merged
Merged
Conversation
Also we could set disallow_incomplete_defs to True Signed-off-by: Yury Pliner <yury.pliner@gmail.com>
3c515e7 to
a34a80f
Compare
Pliner
commented
Jan 28, 2022
| self._raise_if_not_observable() | ||
|
|
||
| def samples(self) -> Iterable[Sample]: | ||
| def samples(_: Gauge) -> Iterable[Sample]: |
Contributor
Author
There was a problem hiding this comment.
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
Pliner
commented
Jan 28, 2022
| return (Sample('', {}, float(f()), None, None),) | ||
|
|
||
| self._child_samples = types.MethodType(samples, self) | ||
| self._child_samples = types.MethodType(samples, self) # type: ignore |
Contributor
Author
There was a problem hiding this comment.
mypy is not fond of such an overwrite of a method
Contributor
Author
|
@csmarchbanks Could you look on it please? Many thanks. |
csmarchbanks
left a comment
Member
There was a problem hiding this comment.
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
csmarchbanks
left a comment
Member
There was a problem hiding this comment.
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
Pliner
commented
Feb 1, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.