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)