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 2017/11/09 22:19:38 UTC
[1/2] beam git commit: Set save_main_session to True for csv module
Repository: beam
Updated Branches:
refs/heads/master ae077cce0 -> dc0892cf1
Set save_main_session to True for csv module
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/58743de5
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/58743de5
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/58743de5
Branch: refs/heads/master
Commit: 58743de5e1b5db8c3a2eea0d08317d7fb843d39f
Parents: ae077cc
Author: David Cavazos <dc...@google.com>
Authored: Wed Nov 8 15:32:03 2017 -0800
Committer: Luke Cwik <lc...@google.com>
Committed: Thu Nov 9 14:19:05 2017 -0800
----------------------------------------------------------------------
sdks/python/apache_beam/examples/complete/game/user_score.py | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/beam/blob/58743de5/sdks/python/apache_beam/examples/complete/game/user_score.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/examples/complete/game/user_score.py b/sdks/python/apache_beam/examples/complete/game/user_score.py
index 3e3e547..6508960 100644
--- a/sdks/python/apache_beam/examples/complete/game/user_score.py
+++ b/sdks/python/apache_beam/examples/complete/game/user_score.py
@@ -61,6 +61,8 @@ import logging
import apache_beam as beam
from apache_beam.metrics.metric import Metrics
+from apache_beam.options.pipeline_options import PipelineOptions
+from apache_beam.options.pipeline_options import SetupOptions
class ParseGameEventFn(beam.DoFn):
@@ -137,6 +139,12 @@ def run(argv=None):
args, pipeline_args = parser.parse_known_args(argv)
+ options = PipelineOptions(pipeline_args)
+
+ # We use the save_main_session option because one or more DoFn's in this
+ # workflow rely on global context (e.g., a module imported at module level).
+ options.view_as(SetupOptions).save_main_session = True
+
with beam.Pipeline(argv=pipeline_args) as p:
def format_user_score_sums(user_score):
(user, score) = user_score
[2/2] beam git commit: Set save_main_session to True for csv module
Posted by lc...@apache.org.
Set save_main_session to True for csv module
This closes #4102
Project: http://git-wip-us.apache.org/repos/asf/beam/repo
Commit: http://git-wip-us.apache.org/repos/asf/beam/commit/dc0892cf
Tree: http://git-wip-us.apache.org/repos/asf/beam/tree/dc0892cf
Diff: http://git-wip-us.apache.org/repos/asf/beam/diff/dc0892cf
Branch: refs/heads/master
Commit: dc0892cf1046766c9a06e9967b2d9e301186defc
Parents: ae077cc 58743de
Author: Luke Cwik <lc...@google.com>
Authored: Thu Nov 9 14:19:29 2017 -0800
Committer: Luke Cwik <lc...@google.com>
Committed: Thu Nov 9 14:19:29 2017 -0800
----------------------------------------------------------------------
sdks/python/apache_beam/examples/complete/game/user_score.py | 8 ++++++++
1 file changed, 8 insertions(+)
----------------------------------------------------------------------