Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Airflow authentication setups fails with "AttributeError: can't set attribute"

The Airflow version 1.8 password authentication setup as described in the docs fails at the step

user.password = 'set_the_password'

with error

AttributeError: can't set attribute
like image 918
DanT Avatar asked Jan 03 '18 10:01

DanT


3 Answers

It's better to simply use the new method of PasswordUser _set_password:

 # Instead of user.password = 'password'
 user._set_password = 'password'
like image 196
Toni Piza Avatar answered Nov 19 '22 20:11

Toni Piza


This is due to an update of SqlAlchemy to a version >= 1.2 that introduced a backwards incompatible change.

You can fix this by explicitly installing a SqlAlchemy version <1.2.

pip install 'sqlalchemy<1.2'

Or in a requirement.txt

sqlalchemy<1.2
like image 29
DanT Avatar answered Nov 19 '22 19:11

DanT


Fixed with

pip install 'sqlalchemy<1.2'

I'm using apache-airflow 1.8.2

like image 1
Feng Xu Avatar answered Nov 19 '22 18:11

Feng Xu