beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rober...@apache.org
Subject [1/2] incubator-beam git commit: Add alias (--extra_packages) for --extra_package
Date Thu, 20 Oct 2016 17:55:16 GMT
Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 8af818a89 -> 513835487


Add alias (--extra_packages) for --extra_package


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

Branch: refs/heads/python-sdk
Commit: c70fd90579f03176350636694663e70ca3746707
Parents: 8af818a
Author: Maria Garcia Herrero <mariagh@google.com>
Authored: Wed Oct 19 21:49:10 2016 -0700
Committer: Maria Garcia Herrero <mariagh@google.com>
Committed: Wed Oct 19 21:49:10 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/utils/options.py               |  2 +-
 sdks/python/apache_beam/utils/pipeline_options_test.py | 11 +++++++++++
 2 files changed, 12 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/c70fd905/sdks/python/apache_beam/utils/options.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/options.py b/sdks/python/apache_beam/utils/options.py
index 4a56ee2..ecc85ba 100644
--- a/sdks/python/apache_beam/utils/options.py
+++ b/sdks/python/apache_beam/utils/options.py
@@ -449,7 +449,7 @@ class SetupOptions(PipelineOptions):
          'tarball from here. If the string "default", '
          'a standard SDK location is used. If empty, no SDK is copied.'))
     parser.add_argument(
-        '--extra_package',
+        '--extra_package', '--extra_packages',
         dest='extra_packages',
         action='append',
         default=None,

http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/c70fd905/sdks/python/apache_beam/utils/pipeline_options_test.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/pipeline_options_test.py b/sdks/python/apache_beam/utils/pipeline_options_test.py
index ddeecaf..3b70e1e 100644
--- a/sdks/python/apache_beam/utils/pipeline_options_test.py
+++ b/sdks/python/apache_beam/utils/pipeline_options_test.py
@@ -109,6 +109,17 @@ class PipelineOptionsTest(unittest.TestCase):
     options = PipelineOptions(flags=[''])
     self.assertEqual(options.get_all_options()['experiments'], None)
 
+  def test_extra_package(self):
+    options = PipelineOptions(['--extra_package', 'abc',
+                               '--extra_packages', 'def',
+                               '--extra_packages', 'ghi'])
+    self.assertEqual(
+        sorted(options.get_all_options()['extra_packages']),
+        ['abc', 'def', 'ghi'])
+
+    options = PipelineOptions(flags=[''])
+    self.assertEqual(options.get_all_options()['extra_packages'], None)
+
 
 if __name__ == '__main__':
   logging.getLogger().setLevel(logging.INFO)


Mime
View raw message