I am using apache-airflow==1.10.0
I get errors that looks like this:
sqlalchemy.exc.ProgrammingError: (psycopg2.ProgrammingError) relation "variable" does not exist
LINE 2: FROM variable
When I declare tasks like:
from airflow.models import Variable
dag = DAG('dag')
PythonOperator('task_id', ratio=Variable.get('ratio'), dag=dag)
because I don't have a Variable table yet. I get errors that don't affect anything, but how can I prevent this from happening?
Run airflow upgradedb
. It will create all the missing tables.
A workaround (in case airflow upgradedb
doesn't work) is to do the following
set_variables()
and commenting it outairflow webserver
and create a dummy variable from the variable UI, this will create the Variable tableset_variables()
, your programmatic calls to variables will now work since you have the Variable tableIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With