You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ke...@apache.org on 2016/07/01 17:50:48 UTC

[2/3] incubator-beam git commit: Set end value in window.py and remove pylint disable statement.

Set end value in window.py and remove pylint disable statement.


Project: http://git-wip-us.apache.org/repos/asf/incubator-beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-beam/commit/833a4b6d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-beam/tree/833a4b6d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-beam/diff/833a4b6d

Branch: refs/heads/python-sdk
Commit: 833a4b6de34186b976a1ad6b0d6894dc3044a371
Parents: 2094e00
Author: Ahmet Altay <al...@google.com>
Authored: Fri Jul 1 10:28:38 2016 -0700
Committer: Ahmet Altay <al...@google.com>
Committed: Fri Jul 1 10:28:38 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/transforms/window.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/833a4b6d/sdks/python/apache_beam/transforms/window.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/window.py b/sdks/python/apache_beam/transforms/window.py
index cc17bcf..eec89c0 100644
--- a/sdks/python/apache_beam/transforms/window.py
+++ b/sdks/python/apache_beam/transforms/window.py
@@ -367,9 +367,10 @@ class Sessions(WindowFn):
 
   def merge(self, merge_context):
     to_merge = []
+    end = timeutil.MIN_TIMESTAMP
     for w in sorted(merge_context.windows, key=lambda w: w.start):
       if to_merge:
-        if end > w.start:  # pylint: disable=used-before-assignment
+        if end > w.start:
           to_merge.append(w)
           if w.end > end:
             end = w.end