-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Remove subdir command from task commands
#47837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Hey @jedcunningham, should we remove the |
| to have succeeded, but found 1 non-success(es). | ||
| """ | ||
| dag = get_dag(args.subdir, args.dag_id) | ||
| dag = _parse_and_get_dag(args.dag_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should just use serialized dag from the db, not reparse it on the fly like this.
| success | ||
| """ | ||
| dag = get_dag(args.subdir, args.dag_id) | ||
| dag = _parse_and_get_dag(args.dag_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.
| def task_list(args, dag: DAG | None = None) -> None: | ||
| """List the tasks within a DAG at the command line.""" | ||
| dag = dag or get_dag(args.subdir, args.dag_id) | ||
| dag = dag or _parse_and_get_dag(args.dag_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
| @providers_configuration_loaded | ||
| def task_render(args, dag: DAG | None = None) -> None: | ||
| """Render and displays templated fields for a given task.""" | ||
| dag = dag or _parse_and_get_dag(args.dag_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here.
Not sure without digging in more. Might be some leftover cruft from subdags possibly? |
I was referring to this function. |
| if args.dag_id and not args.dag_regex and not args.task_regex: | ||
| dags = [get_dag_by_file_location(args.dag_id)] | ||
| else: | ||
| # todo clear command only accepts a single dag_id. no reason for get_dags with 's' except regex? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this function should be maintained because if the user wants to use regex, dag_id is treated as a regex.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I made the changes accordingly.
0a9c459 to
6ac6d36
Compare
|
Hey @jedcunningham, can you please take a look and help me understand why the test case is failing? |
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Roughly tracing all the way down, it seems that the task_to_execute we pass to ExecutionCallableRunner
https://github.com/apache/airflow/blob/main/airflow-core/src/airflow/models/taskinstance.py#L610
is a BaseOperator instead of a PythonOperator (or another Python-based operator inheriting from BaseOperator). Compared to the example_python_operator DAG
this results in a NotImplementedError being raised from BaseOperator.execute
| @@ -1,4 +1,4 @@ | |||
| # | |||
| # No code was selected, so we can't improve anything.# | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Seems like your colleague has left here xD
Thanks for the amazing insights, @jason810496! I’m wondering why these are failing since nothing related to them is being changed in the PR. |
I'm not sure at the moment, so we need to dig along the path I described to find out. |
7833efd to
0e644d7
Compare
0e644d7 to
bb1fb08
Compare
jason810496
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think #49317 will include the scope of this PR right ?
Yeah. |

related: #45647