Skip to content

Commit

Permalink
Suppress SQLALCHEMY_TRACK_MODIFICATIONS warning in db init (#26617)
Browse files Browse the repository at this point in the history
We already have it set false in the main flask app config, but now that we do db init from orm, and we create a distinct flask app for that, and it doesn't get the same setting.

Closes #26544

(cherry picked from commit 051ba15)
  • Loading branch information
dstandish authored and jedcunningham committed Sep 23, 2022
1 parent 329f706 commit 5ae47cd
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions airflow/utils/db.py
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,7 @@ def _create_db_from_orm(session):
def _create_flask_session_tbl():
flask_app = Flask(__name__)
flask_app.config['SQLALCHEMY_DATABASE_URI'] = conf.get('database', 'SQL_ALCHEMY_CONN')
flask_app.config['SQLALCHEMY_TRACK_MODIFICATIONS'] = False
db = SQLAlchemy(flask_app)
AirflowDatabaseSessionInterface(app=flask_app, db=db, table='session', key_prefix='')
db.create_all()
Expand Down

0 comments on commit 5ae47cd

Please sign in to comment.