You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by je...@apache.org on 2022/09/23 17:25:50 UTC
[airflow] 01/02: Suppress SQLALCHEMY_TRACK_MODIFICATIONS warning in db init (#26617)
This is an automated email from the ASF dual-hosted git repository.
jedcunningham pushed a commit to branch v2-4-test
in repository https://gitbox.apache.org/repos/asf/airflow.git
commit 5ae47cd45fac9ff286b1e147f538fba1beccedee
Author: Daniel Standish <15...@users.noreply.github.com>
AuthorDate: Fri Sep 23 00:18:52 2022 -0700
Suppress SQLALCHEMY_TRACK_MODIFICATIONS warning in db init (#26617)
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 051ba159e54b992ca0111107df86b8abfd8b7279)
---
airflow/utils/db.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/airflow/utils/db.py b/airflow/utils/db.py
index 843e6521b3..38887626de 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()