You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2022/07/12 11:28:06 UTC
[GitHub] [airflow] rahulgoyal2987 opened a new issue, #24996: Airflow doesn't set default task group while calling dag.add_tasks
rahulgoyal2987 opened a new issue, #24996:
URL: https://github.com/apache/airflow/issues/24996
### Apache Airflow version
2.3.3 (latest released)
### What happened
Airflow set default task group while creating operator if dag parameter is set
https://github.com/apache/airflow/blob/main/airflow/models/baseoperator.py#L236
However, It doesn't set the default task group while adding a task using dag.add_task function
https://github.com/apache/airflow/blob/main/airflow/models/dag.py#L2179
This broke the code at line no
https://github.com/apache/airflow/blob/main/airflow/models/taskmixin.py#L312 and getting the error Cannot check for mapped dependants when not attached to a DAG.
Please add below line in dag.add_task function also:
if dag:
task_group = TaskGroupContext.get_current_task_group(dag)
if task_group:
task_id = task_group.child_id(task_id)
### What you think should happen instead
It should not break if task is added using dag.add_task
### How to reproduce
don't dag parameter while creating operator object. add task using add_task in dag.
### Operating System
Any
### Versions of Apache Airflow Providers
_No response_
### Deployment
Official Apache Airflow Helm Chart
### Deployment details
_No response_
### Anything else
_No response_
### Are you willing to submit PR?
- [ ] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://github.com/apache/airflow/blob/main/CODE_OF_CONDUCT.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk closed issue #24996: Airflow doesn't set default task group while calling dag.add_tasks
Posted by GitBox <gi...@apache.org>.
potiuk closed issue #24996: Airflow doesn't set default task group while calling dag.add_tasks
URL: https://github.com/apache/airflow/issues/24996
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] potiuk commented on issue #24996: Airflow doesn't set default task group while calling dag.add_tasks
Posted by GitBox <gi...@apache.org>.
potiuk commented on issue #24996:
URL: https://github.com/apache/airflow/issues/24996#issuecomment-1181651568
Would you like to make a PR fixing it? Airflow is created by > 2100 contributors - mostly users like yoy. You seem to know exactly what should be fixed - why not becoming one of the contributrors?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [airflow] blcksrx commented on issue #24996: Airflow doesn't set default task group while calling dag.add_tasks
Posted by GitBox <gi...@apache.org>.
blcksrx commented on issue #24996:
URL: https://github.com/apache/airflow/issues/24996#issuecomment-1181688484
Im working on it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org