turbaszek commented on a change in pull request #13479:
URL: https://github.com/apache/airflow/pull/13479#discussion_r575665958
##########
File path: docs/apache-airflow/concepts.rst
##########
@@ -1121,6 +1121,26 @@ This animated gif shows the UI interactions. TaskGroups
are expanded or collapse
.. image:: img/task_group.gif
+TaskGroup can be created using ``@taskgroup decorator``, it takes one
mandatory argument ``group_id`` which is same as constructor of TaskGroup
class, if not given it copies function name as ``group_id``. It works exactly
same as creating TaskGroup using context manager ``with TaskGroup('groupid') as
section:``.
+
+.. code-block:: python
+
+ @task
+ def task_1(value):
+ return f'[ Task1 {value} ]'
+
+
+ @task
+ def task_2(value):
+ print(f'[ Task2 {value} ]')
+
+
+ @taskgroup
+ def section_1(value):
+ return task_2(task_1(value))
Review comment:
Should we use the `exampleinclude` to use code from example DAg instead
of hardcoding it in docs?
```
.. exampleinclude::
/../../airflow/providers/apache/beam/example_dags/example_beam.py
:language: python
:dedent: 4
:start-after: [START
howto_operator_start_python_dataflow_runner_pipeline_gcs_file]
:end-before: [END
howto_operator_start_python_dataflow_runner_pipeline_gcs_file]
```
----------------------------------------------------------------
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]