Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk a60b58a94 -> ebae225ed


Allow pickling of UnwindowedValues instances

These are trivial wrappers produced when "windowing" by the global window, but 
may need to be materialized in some cases.

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

Branch: refs/heads/python-sdk
Commit: 63904e01f52be498ba3c8c9e1989bcffb02dfcd6
Parents: a60b58a
Author: Robert Bradshaw <rober...@gmail.com>
Authored: Thu Sep 15 17:00:42 2016 -0700
Committer: GitHub <nore...@github.com>
Committed: Thu Sep 15 17:00:42 2016 -0700

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


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/63904e01/sdks/python/apache_beam/transforms/trigger.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/transforms/trigger.py 
b/sdks/python/apache_beam/transforms/trigger.py
index 587384a..58b6154 100644
--- a/sdks/python/apache_beam/transforms/trigger.py
+++ b/sdks/python/apache_beam/transforms/trigger.py
@@ -734,6 +734,9 @@ class DefaultGlobalBatchTriggerDriver(TriggerDriver):
 
         def __repr__(self):
           return '<UnwindowedValues of %s>' % windowed_values
+
+        def __reduce__(self):
+          return list, (list(self),)
       unwindowed = UnwindowedValues()
     yield WindowedValue(unwindowed, MIN_TIMESTAMP, self.GLOBAL_WINDOW_TUPLE)
 

Reply via email to