ashb commented on PR #24486:
URL: https://github.com/apache/airflow/pull/24486#issuecomment-1237975398
I've found an easy way to make sure all models are loaded when needed:
```
event.listen(sqlalchemy.orm.mapper, "before_configured",
import_all_models, once=True)
```
This will ensure that on the first time any model class is queried or
instantiated all other models will be loaded, which ensures we don't get the
"class not found in registry" error message, but still means imports are
"quick".
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]