'Add a task to the DAG
:param task: the task you want to add
:type task: task'

def add_task(self, task):

    if ((not self.start_date) and (not task.start_date)):
        raise AirflowException(u'Task    is    missing    the    start_date    parameter')
    elif (not task.start_date):
        task.start_date = self.start_date
    elif self.start_date:
        task.start_date = max(task.start_date, self.start_date)
    if (not task.end_date):
        task.end_date = self.end_date
    elif (task.end_date and self.end_date):
        task.end_date = min(task.end_date, self.end_date)
    if (task.task_id in self.task_dict):
        warnings.warn(u'The    requested    task    could    not    be    added    to    the    DAG    because    a    task    with    task_id    {}    is    already    in    the    DAG.    Starting    in    Airflow    2.0,    trying    to    overwrite    a    task    will    raise    an    exception.'.format(task.task_id), category=PendingDeprecationWarning)
    else:
        self.tasks.append(task)
        self.task_dict[task.task_id] = task
        task.dag = self
    self.task_count = len(self.tasks)
