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 2021/09/22 13:44:10 UTC

[GitHub] [airflow] josh-fell commented on pull request #18278: Updating miscellaneous provider DAGs to use TaskFlow API where applicable

josh-fell commented on pull request #18278:
URL: https://github.com/apache/airflow/pull/18278#issuecomment-924944739


   
   
   
   > Just thinking if we should show an example of using `@dag.task`?
   > 
   > ```python
   > dag = DAG('dag_id')
   > 
   > @dag.task
   > def mytask():
   >     print('something')
   > ```
   > 
   > WDYT @josh-fell
   
   The `example_kylin_dag` and `example_sqlite` DAG are both using this syntax (with the latter even showing passing `task_id` to the decorator which has come up several times in StackOverflow and Slack). For the core Airflow example DAGs -- that I'm also working on updating -- there doesn't seem to any existing non-context manager `DAG()` instantiations. However, I feel like this syntax should be in the Concepts/TaskFlow documentation as an explicit option for folks to declare tasks since it feels like an easter egg of sorts right now.


-- 
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