How to determine if the command of Airflow initdb ran ?

1,473 views
Skip to first unread message

Costya Regev

unread,
Jan 18, 2016, 3:16:02 PM1/18/16
to Airflow
Hi , 

Im wondering if there is a way to determine if the command "airflow initdb" ran ... 
I know that this command should run only once when we initialize the Database , i want a generic command to be able to check if the command ran regardless of the backend  that is used in airflow.cfg.
 Currently im checking it via mysql query to see if a table exists , but what if we will change the backend to something else...
Thanks in Advance,
Costya.

Maxime Beauchemin

unread,
Jan 19, 2016, 1:27:13 AM1/19/16
to Airflow
Do you mean programmatically in Python? If so you could just wrap a generic sqlalchemy query in a try statement. If the table isn't there it will raise.

Costya Regev

unread,
Jan 19, 2016, 2:22:05 PM1/19/16
to Airflow
I want to have the ability to know if the user which ran the installation of Airflow for the first time ran the command  "airflow initdb" if not i would like to run it myself via a configuration manager.

Maxime Beauchemin

unread,
Jan 20, 2016, 5:30:49 PM1/20/16
to Airflow
It's non destruction, so you can run it twice or as many times as you want.

Max

Costya Regev

unread,
Jan 23, 2016, 1:42:59 AM1/23/16
to Airflow
Thanks.
Reply all
Reply to author
Forward
0 new messages