You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by lc...@apache.org on 2020/03/09 22:32:12 UTC

[beam] branch master updated: [BEAM-9475] Fix typos and shore up expectations on type

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

lcwik 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 dce7205  [BEAM-9475] Fix typos and shore up expectations on type
     new fd5a803  Merge pull request #11085 from lukecwik/beam9475
dce7205 is described below

commit dce72054a15a3eb246fc65f10f06489399469368
Author: Luke Cwik <lc...@google.com>
AuthorDate: Mon Mar 9 13:17:41 2020 -0700

    [BEAM-9475] Fix typos and shore up expectations on type
    
    This fixes a regression caused in pr/10956
---
 sdks/python/apache_beam/runners/worker/operations.py | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/sdks/python/apache_beam/runners/worker/operations.py b/sdks/python/apache_beam/runners/worker/operations.py
index 3813472..6d71dc5 100644
--- a/sdks/python/apache_beam/runners/worker/operations.py
+++ b/sdks/python/apache_beam/runners/worker/operations.py
@@ -839,22 +839,23 @@ class SdfProcessSizedElements(DoOperation):
                     self).monitoring_infos(transform_id)
       current_element_progress = self.current_element_progress()
       if current_element_progress:
-        if current_element_progress.completed_work():
-          completed = current_element_progress.completed_work()
-          remaining = current_element_progress.remaining_work()
+        if current_element_progress.completed_work:
+          completed = current_element_progress.completed_work
+          remaining = current_element_progress.remaining_work
         else:
-          completed = current_element_progress.fraction_completed()
-          remaining = current_element_progress.fraction_remaining()
-
+          completed = current_element_progress.fraction_completed
+          remaining = current_element_progress.fraction_remaining
+        assert completed is not None
+        assert remaining is not None
         completed_mi = metrics_pb2.MonitoringInfo(
             urn=monitoring_infos.WORK_COMPLETED_URN,
-            type=monitoring_infos.LATEST_DOUBLES_URN,
+            type=monitoring_infos.LATEST_DOUBLES_TYPE,
             labels=monitoring_infos.create_labels(ptransform=transform_id),
             payload=coders.FloatCoder().get_impl().encode_nested(completed),
             timestamp=monitoring_infos.to_timestamp_proto(time.time()))
         remaining_mi = metrics_pb2.MonitoringInfo(
             urn=monitoring_infos.WORK_REMAINING_URN,
-            type=monitoring_infos.LATEST_DOUBLES_URN,
+            type=monitoring_infos.LATEST_DOUBLES_TYPE,
             labels=monitoring_infos.create_labels(ptransform=transform_id),
             payload=coders.FloatCoder().get_impl().encode_nested(remaining),
             timestamp=monitoring_infos.to_timestamp_proto(time.time()))