Repository: incubator-airflow Updated Branches: refs/heads/master 55b7c1b59 -> 785dd1901
[AIRFLOW-415] Make dag_id not found error clearer When a dag fails to parse and a user tries to run it e.g. via the command line airflow will give an error "dag_id not found" which is not clear since it sounds like the dag is completely missing rather than it just failing to parse. The message should be made clearer to address this possibility. The longer term fix is to not display exceptions with tracebacks to users like this but catch and give an error message. Please accept this PR that addresses the following issues: - https://issues.apache.org/jira/browse/AIRFLOW-415 artwr mistercrunch Closes #1725 from aoen/ddavydov/clearer_dag_could_not_be_found_error Project: http://git-wip-us.apache.org/repos/asf/incubator-airflow/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-airflow/commit/785dd190 Tree: http://git-wip-us.apache.org/repos/asf/incubator-airflow/tree/785dd190 Diff: http://git-wip-us.apache.org/repos/asf/incubator-airflow/diff/785dd190 Branch: refs/heads/master Commit: 785dd1901d3fdae3f2b4c92e06c868415ff275a5 Parents: 55b7c1b Author: Dan Davydov <dan.davy...@airbnb.com> Authored: Thu Aug 11 19:26:59 2016 -0700 Committer: Siddharth Anand <siddharthan...@yahoo.com> Committed: Thu Aug 11 19:26:59 2016 -0700 ---------------------------------------------------------------------- airflow/bin/cli.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-airflow/blob/785dd190/airflow/bin/cli.py ---------------------------------------------------------------------- diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py index aa998a1..6750e10 100755 --- a/airflow/bin/cli.py +++ b/airflow/bin/cli.py @@ -110,7 +110,8 @@ def get_dag(args): dagbag = DagBag(process_subdir(args.subdir)) if args.dag_id not in dagbag.dags: raise AirflowException( - 'dag_id could not be found: {}'.format(args.dag_id)) + 'dag_id could not be found: {}. Either the dag did not exist or it failed to ' + 'parse.'.format(args.dag_id)) return dagbag.dags[args.dag_id]