Used in https://github.com/mhenc/airflow/blob/master/airflow/dag_processing/manager.py#L613

should be straighforward
"""Print an ASCII tree representation of the DAG."""
        def get_downstream(task, level=0):
            print((" " * level * 4) + str(task))
            level += 1
            for t in task.downstream_list:
                get_downstream(t, level)
        for t in self.roots:
            get_downstream(t)
    @property
    def task(self) -> TaskDecoratorCollection:
        from airflow.decorators import task
        return cast("TaskDecoratorCollection", functools.partial(task, dag=self))
    def add_task(self, task: Operator) -> None:
        """
        Add a task to the DAG
        :param task: the task you want to add
        """
        from airflow.utils.task_group import TaskGroupContext
        if not self.start_date and not task.start_date:
            raise AirflowException("DAG is missing the start_date parameter")