Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Testing Airflow Dag in command line

Tags:

airflow

From Airflow manual at https://airflow.apache.org/tutorial.html#testing, I found that I can run something like following to test a specific task:

airflow test dag_id task_id

When I did, I only got this message:

[2018-07-10 18:29:54,346] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/Grammar.txt
[2018-07-10 18:29:54,367] {driver.py:120} INFO - Generating grammar tables from /usr/lib/python2.7/lib2to3/PatternGrammar.txt
[2018-07-10 18:29:54,477] {__init__.py:45} INFO - Using executor SequentialExecutor
[2018-07-10 18:29:54,513] {models.py:189} INFO - Filling up the DagBag from /var/lib/airflow/dags

It doesn't look like it is really running it. Am I misunderstood? Or is there another way to run a DAG locally?

like image 761
kee Avatar asked Aug 30 '26 00:08

kee


1 Answers

I copied this example call from the paragraph in the page you have linked to:

# command layout: command subcommand dag_id task_id date

# testing print_date
airflow test tutorial print_date 2015-06-01

# testing sleep
airflow test tutorial sleep 2015-06-01

So just include the date as shown above and the DAG task should run as expected.

like image 120
tobi6 Avatar answered Sep 04 '26 13:09

tobi6



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!