When a workflow discovers an unknown number of movie reviews, expand() lets Airflow create one mapped task instance for each review instead of processing them in a loop. section 12.1.8
Map a task over fetched reviews
Keep shared operator arguments in partial(), then supply the mapped values through expand(): PythonOperator.partial(task_id="print_rating", python_callable=_print_rating).expand(op_args=fetch_ratings.output). The fetch task runs first; Airflow creates and independently processes one print task for each returned review.
Each DAG run can produce a different number of instances. Airflow exposes mapped tasks in the grid and graph views with [] notation and individual instances.
