You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by ro...@apache.org on 2016/12/08 02:17:58 UTC

[1/2] incubator-beam git commit: Fix template_runner_test on Windows

Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 4a660c604 -> 43057960a


Fix template_runner_test on Windows


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

Branch: refs/heads/python-sdk
Commit: a565ca1008309564dba41d551c68ea553cd83a7b
Parents: 4a660c6
Author: Charles Chen <cc...@google.com>
Authored: Wed Dec 7 16:09:49 2016 -0800
Committer: Charles Chen <cc...@google.com>
Committed: Wed Dec 7 16:09:49 2016 -0800

----------------------------------------------------------------------
 .../apache_beam/runners/template_runner_test.py       | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/a565ca10/sdks/python/apache_beam/runners/template_runner_test.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/runners/template_runner_test.py b/sdks/python/apache_beam/runners/template_runner_test.py
index a141521..cc3d7c2 100644
--- a/sdks/python/apache_beam/runners/template_runner_test.py
+++ b/sdks/python/apache_beam/runners/template_runner_test.py
@@ -33,24 +33,30 @@ from apache_beam.internal import apiclient
 class TemplatingDataflowPipelineRunnerTest(unittest.TestCase):
   """TemplatingDataflow tests."""
   def test_full_completion(self):
-    dummy_file = tempfile.NamedTemporaryFile()
+    # Create dummy file and close it.  Note that we need to do this because
+    # Windows does not allow NamedTemporaryFiles to be reopened elsewhere
+    # before the temporary file is closed.
+    dummy_file = tempfile.NamedTemporaryFile(delete=False)
+    dummy_file_name = dummy_file.name
+    dummy_file.close()
+
     dummy_dir = tempfile.mkdtemp()
 
     remote_runner = DataflowPipelineRunner()
     pipeline = Pipeline(remote_runner,
                         options=PipelineOptions([
                             '--dataflow_endpoint=ignored',
-                            '--sdk_location=' + dummy_file.name,
+                            '--sdk_location=' + dummy_file_name,
                             '--job_name=test-job',
                             '--project=test-project',
                             '--staging_location=' + dummy_dir,
                             '--temp_location=/dev/null',
-                            '--template_location=' + dummy_file.name,
+                            '--template_location=' + dummy_file_name,
                             '--no_auth=True']))
 
     pipeline | beam.Create([1, 2, 3]) | beam.Map(lambda x: x) # pylint: disable=expression-not-assigned
     pipeline.run()
-    with open(dummy_file.name) as template_file:
+    with open(dummy_file_name) as template_file:
       saved_job_dict = json.load(template_file)
       self.assertEqual(
           saved_job_dict['environment']['sdkPipelineOptions']


[2/2] incubator-beam git commit: Closes #1548

Posted by ro...@apache.org.
Closes #1548


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

Branch: refs/heads/python-sdk
Commit: 43057960af906ff5c435ea016d5f6df5bccaea40
Parents: 4a660c6 a565ca1
Author: Robert Bradshaw <ro...@google.com>
Authored: Wed Dec 7 18:17:39 2016 -0800
Committer: Robert Bradshaw <ro...@google.com>
Committed: Wed Dec 7 18:17:39 2016 -0800

----------------------------------------------------------------------
 .../apache_beam/runners/template_runner_test.py       | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------