This is an automated email from the ASF dual-hosted git repository.

yichi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new ac24771d563 [BEAM-11578] Fix TypeError in dataflow_metrics has 0 
distribution sum (#17706)
ac24771d563 is described below

commit ac24771d5631f952b8253f54637c3b12e12356d3
Author: Yi Hu <[email protected]>
AuthorDate: Mon May 23 14:55:53 2022 -0400

    [BEAM-11578] Fix TypeError in dataflow_metrics has 0 distribution sum 
(#17706)
---
 sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py 
b/sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py
index 41c13b2074f..516e0ffd160 100644
--- a/sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py
+++ b/sdks/python/apache_beam/runners/dataflow/dataflow_metrics.py
@@ -219,7 +219,7 @@ class DataflowMetrics(MetricResults):
       dist_sum = _get_match(
           metric.distribution.object_value.properties,
           lambda x: x.key == 'sum').value.integer_value
-      if not dist_sum:
+      if dist_sum is None:
         # distribution metric is not meant to use on large values, but in case
         # it is, the value can overflow and become double_value, the 
correctness
         # of the value may not be guaranteed.

Reply via email to