github-actions[bot] opened a new pull request, #74971: URL: https://github.com/apache/airflow/pull/74971
Models name each other in string relationships, which only resolve once every model module is imported. The before_configured hook that imports them all was registered in configure_orm(), so a process that skips it (virtualenv-mode subprocesses, a task re-executed for run_as_user, non-DB tests) or configures mappers before it runs (local settings) only worked if it had already imported the right model modules. If it had not, building a model failed, for example with Team.dag_bundles unable to find DagBundleModel. Register the hook in airflow.models.base, before any model class is defined, and drop the test-only copy from the pytest plugin. Remove the orm_event_handlers test: it guarded the line that moved, and now passes whatever the code does. (cherry picked from commit d79c0b18f35d025e14a62aab9ee288230245eb83) Co-authored-by: Kaxil Naik <[email protected]> -- 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]
