from airflow.models import DAG

def subdag_factory(parent_dag_name, child_dag_name, default_args):
    with DAG(
        dag_id='%s.%s' % (parent_dag_name, child_dag_name),
        default_args=default_args
    ) as dag_subdag:

    return dag_subdag