From ac24771d5631f952b8253f54637c3b12e12356d3 Mon Sep 17 00:00:00 2001 From: Yi Hu Date: Mon, 23 May 2022 14:55:53 -0400 Subject: [PATCH] [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 41c13b2074f5..516e0ffd160e 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 @@ def _get_metric_value(self, metric): 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.