Skip to content

Commit 78c6f49

Browse files
committed
Remove invalid HasField check on proto3 scalar metric value
Scalar fields do not have HasField check in proto3. Signed-off-by: cwasicki <[email protected]>
1 parent 4ff0b89 commit 78c6f49

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/frequenz/client/reporting/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ def sample(self) -> MetricSample:
190190
metric = Metric(config.metric).name
191191
# Ignoring this verification results in
192192
# values of zero if the field is not set.
193-
if sample.HasField("sample") and sample.sample.HasField("value"):
193+
if sample.HasField("sample"):
194194
value = sample.sample.value
195195
else:
196196
value = math.nan

0 commit comments

Comments
 (0)