From 3d6b465f96694353dfa0204e8ac8b37ba47b6f25 Mon Sep 17 00:00:00 2001 From: Daniel Standish <15932138+dstandish@users.noreply.github.com> Date: Thu, 22 Sep 2022 23:11:18 -0700 Subject: [PATCH] Suppress SQLALCHEMY_TRACK_MODIFICATIONS warning in db init 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 --- airflow/utils/db.py | 1 + 1 file changed, 1 insertion(+) diff --git a/airflow/utils/db.py b/airflow/utils/db.py index 843e6521b3609..38887626ded94 100644 --- a/airflow/utils/db.py +++ b/airflow/utils/db.py @@ -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()