Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
apache_airflow [2019/02/26 00:03]
root [Examples - Links and References]
apache_airflow [2019/05/09 04:45] (current)
root [DAG's Creating and Testing]
Line 52: Line 52:
  
 Look to generate similar matrix of connections as http://​front.topostgres.com/​ Look to generate similar matrix of connections as http://​front.topostgres.com/​
 +
 +== DAG's Creating and Testing ​ == 
 +
 +For any action/dag there needs to be an initial configuration including ​
 +* name
 +* job description ​
 +* schedule ​
 +* start time 
 +* catchup on past jobs 
 +
 +<code python>
 +dag = DAG('​hello_world',​ description='​Hello world example',​ schedule_interval='​0 12 * * *', start_date=datetime(2017,​ 3, 20), catchup=False)
 +</​code>​
 +
 +* Operators ​
 +
 +<code python>
 +dummy_operator = DummyOperator(task_id='​dummy_task',​ retries = 3, dag=dag)
 +</​code>​
 +
 +Links operators to tasks:
 +
 +<code python>
 +dummy_operator >> hello_operator
 +</​code>​
 +
 +<code bash>
 +$ airflow run ... - run a task instance
 +$ airflow test ... - test a task instance without checking dependencies or recording state in database
 +$ airflow trigger_dag ... - trigger a specific DAG run of a DAG
 +</​code>​
 +
 +https://​blog.usejournal.com/​testing-in-airflow-part-1-dag-validation-tests-dag-definition-tests-and-unit-tests-2aa94970570c
 == Testing ==  == Testing == 
 * [[https://​blog.usejournal.com/​testing-in-airflow-part-1-dag-validation-tests-dag-definition-tests-and-unit-tests-2aa94970570c?​gi=d0f94f3abdd9 |  Testing Dags]] * [[https://​blog.usejournal.com/​testing-in-airflow-part-1-dag-validation-tests-dag-definition-tests-and-unit-tests-2aa94970570c?​gi=d0f94f3abdd9 |  Testing Dags]]
 
apache_airflow.1551168193.txt.gz · Last modified: 2019/02/26 00:03 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd