Repository: incubator-beam
Updated Branches:
  refs/heads/python-sdk 1260bf779 -> 8af818a89


Better error for missing job name


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

Branch: refs/heads/python-sdk
Commit: fdb05b77f94dce9be9cdb49c145b7fb379cae8bd
Parents: 1260bf7
Author: Robert Bradshaw <rober...@google.com>
Authored: Tue Oct 18 16:15:12 2016 -0700
Committer: Robert Bradshaw <rober...@gmail.com>
Committed: Tue Oct 18 23:41:28 2016 -0700

----------------------------------------------------------------------
 sdks/python/apache_beam/utils/pipeline_options_validator.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-beam/blob/fdb05b77/sdks/python/apache_beam/utils/pipeline_options_validator.py
----------------------------------------------------------------------
diff --git a/sdks/python/apache_beam/utils/pipeline_options_validator.py 
b/sdks/python/apache_beam/utils/pipeline_options_validator.py
index fe74885..b7b2978 100644
--- a/sdks/python/apache_beam/utils/pipeline_options_validator.py
+++ b/sdks/python/apache_beam/utils/pipeline_options_validator.py
@@ -145,8 +145,9 @@ class PipelineOptionsValidator(object):
     """Validates job_name and project arguments."""
     errors = []
     job_name = view.job_name
-    if (job_name is None or
-        not self.is_full_string_match(self.JOB_PATTERN, job_name)):
+    if job_name is None:
+      errors.extend(self._validate_error(self.ERR_MISSING_OPTION, 'job_name'))
+    elif not self.is_full_string_match(self.JOB_PATTERN, job_name):
       errors.extend(self._validate_error(self.ERR_INVALID_JOB_NAME, job_name))
 
     project = view.project

Reply via email to