Skip to content

Commit

Permalink
Merge pull request #4721 from [BEAM-1866] Fixing nanosecond translati…
Browse files Browse the repository at this point in the history
…on issue in Gauge Fn API translation.

[BEAM-1866] Fixing nanosecond translation issue in Gauge Fn API translation.
  • Loading branch information
robertwb authored Feb 21, 2018
2 parents 80fa9f8 + 6cf63af commit ce0c92e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sdks/python/apache_beam/metrics/cells.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down

0 comments on commit ce0c92e

Please sign in to comment.