airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Choose setting for sqlalchemy SQLALCHEMY_TRACK_MODIFICATIONS

Open dstandish opened this issue 3 years ago • 2 comments

Body

We need to determine what to do about this warning:

/Users/dstandish/.virtualenvs/2.4.0/lib/python3.8/site-packages/flask_sqlalchemy/__init__.py:872 FSADeprecationWarning: SQLALCHEMY_TRACK_MODIFICATIONS adds significant overhead and will be disabled by default in the future.  Set it to True or False to suppress this warning.

Should we set to true or false?

@ashb @potiuk @jedcunningham @uranusjr

Committer

  • [X] I acknowledge that I am a maintainer/committer of the Apache Airflow project.

dstandish avatar Sep 21 '22 00:09 dstandish

Looking at the answers here https://stackoverflow.com/questions/33738467/how-do-i-know-if-i-can-disable-sqlalchemy-track-modifications, we should set it to False. From what I checked, we do not seem to use "models_committed" or "before_models_committed" anywhere - neither Airflow nor any other dependency uses it (except flask_sqlalchemy that defines it of course).

potiuk avatar Sep 21 '22 10:09 potiuk

Agreed, False.

ashb avatar Sep 21 '22 11:09 ashb

Turns out 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, it doesn't get the same setting....

dstandish avatar Sep 23 '22 06:09 dstandish