from airflow import DAG import dagfactory config_file = "/usr/local/airflow/dags/example_dag_factory.yml" example_dag_factory = dagfactory.DagFactory(config_file) # Creating task dependencies example_dag_factory.clean_dags(globals()) example_dag_factory.generate_dags(globals())
from airflow import DAG import dagfactory dag_factory = dagfactory.DagFactory("/home/ubuntu/airflow/dags/Airflow2/config_file.yml") dag_factory.generate_dags(globals())
import dagfactory from airflow import DAG from datetime import datetime, timedelta dag_factory = dagfactory.DagFactory("/path/to/dags/dags.yaml") dag_factory.generate_dags(globals())
import os import glob from airflow import DAG import dagfactory AIRFLOW_DAGS = os.path.join( os.environ.get('AIRFLOW_HOME', os.getcwd()), 'dags') YAML_DAGS = os.path.join(AIRFLOW_DAGS, '*.yml') for dag_file in glob.glob(YAML_DAGS): dag_factory = dagfactory.DagFactory(dag_file) dag_factory.generate_dags(globals())
from airflow import DAG import dagfactory from airflow.models import Variable airflow_home_path = Variable.get("home") dag_factory = dagfactory.DagFactory(airflow_home_path + "/dags/tutorial_dag.yml") dag_factory.clean_dags(globals()) dag_factory.generate_dags(globals())
from airflow import DAG import dagfactory dag_factory = dagfactory.DagFactory("/usr/local/airflow/include/config_file.yml") dag_factory.clean_dags(globals()) dag_factory.generate_dags(globals())