VBhojawala commented on pull request #13912:
URL: https://github.com/apache/airflow/pull/13912#issuecomment-767487249
@task decorator currently does not support task ordering and does not
returns PythonOperator instance.
For example following dag will give
``` python
from airflow.models import DAG
import os
from airflow.operators.python import PythonOperator, task
from airflow.utils.dates import days_ago
default_args = {'start_date': days_ago(1)}
dag_name = os.path.splitext(os.path.basename(__file__))[0]
@task
def some_py_task(name):
""" some py task """
print(f'Inside Python Task name: {name}')
def some_other_task(name):
""" some other task"""
print(f'Inside {name} Task')
with DAG(dag_name, default_args=default_args) as dag:
t1 = some_other_task('task1')
t2 = some_other_task('task2')
t3 = PythonOperator(python_callable=some_other_task, task_id='task3',
op_args=['task3'])
t1 >> t2 >> t3
```

----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]