From 6cf63afc45645aea5a43566f37756de2faee67dd Mon Sep 17 00:00:00 2001 From: Pablo Date: Wed, 21 Feb 2018 10:58:31 -0800 Subject: [PATCH] Fixing nanosecond translation issue in Gauge Fn API translation. --- sdks/python/apache_beam/metrics/cells.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/metrics/cells.py b/sdks/python/apache_beam/metrics/cells.py index 8271a5c64d52..302d79ab5127 100644 --- a/sdks/python/apache_beam/metrics/cells.py +++ b/sdks/python/apache_beam/metrics/cells.py @@ -359,7 +359,8 @@ def to_runner_api(self): @staticmethod def from_runner_api(proto): - gauge_timestamp = proto.timestamp.seconds + proto.timestamp.nanos / 10**9 + gauge_timestamp = (proto.timestamp.seconds + + float(proto.timestamp.nanos) / 10**9) return GaugeData(proto.value, timestamp=gauge_timestamp)