tvalentyn commented on a change in pull request #16154:
URL: https://github.com/apache/beam/pull/16154#discussion_r794171212



##########
File path: sdks/python/apache_beam/examples/complete/autocomplete.py
##########
@@ -40,7 +40,7 @@ def run(argv=None):
   # 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).
   pipeline_options = PipelineOptions(pipeline_args)
-  pipeline_options.view_as(SetupOptions).save_main_session = True
+  pipeline_options.view_as(SetupOptions).save_main_session = save_main_session

Review comment:
       @benWize is the TestDirectRunner the only one affected by it? If so, we 
could potentially override this setting in 
https://github.com/apache/beam/blob/5e528cf4889b2393703ba00e2db8fad0e406b730/sdks/python/apache_beam/runners/direct/test_direct_runner.py#L42.
 Otherwise I guess we can go as is, unless @ryanthompson has some other ideas 
to avoid the awkwardness of this flag until CloudPickle helps us get rid of it. 
perhaps we can still comment that branching is needed for testing only, but in 
the examples themselves users would pass True




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to