-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Import missing modules when importing all DB models #45244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Example errors appearing in xdist tests here: |
536be52 to
44920c3
Compare
44920c3 to
0a62b30
Compare
Importing all modules did not include importing trigger module, and this caused strange errors when running tests that never imported Trigger separately. Similaarly Xcom and Variables have not been imported
0a62b30 to
b81c5ff
Compare
|
lso it is likely that this one was impacting some other ways Airflow DB is initialized: #45236 |
|
I am not sure if we are missing other models here, but generally, depending on what sequence imports happened our DB scripts could "forget" to create certain tables, and our tests were failing with missing associations if referred DB models were not imported in earlier tests. This is somewhat a weakness of our "imports" doing a lot of work implicitly (and sometimes forgetting to do it). |
|
Though @uranusjr @ashb -> I am not sure if this is right - I also saw that there are those _getrr calls for all lazy imports, so I am not at all sure if this is the right approach what I am doing - this mechanism of sometimes lazy, sometimes not importing of modules is .... complex ... and I am not sure what the intentions were to have some of the modules lazy and some not... So I am not all sure if what I am doing here is fine. |
|
Nope. It does not help; |
Importing all modules did not include importing trigger module, and this caused strange errors when running tests that never imported Trigger separately.
Similaarly Xcom and Variables have not been imported
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in newsfragments.