-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
fix: add back database lookup from sip 68 revert #22129
Conversation
data_model = SQLAInterface(SqlaTable, db.session) | ||
query = DatasourceFilter(cls.id_column_name, data_model).apply(query, None) | ||
return query.all() | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method was added in to the original PR to eager load the database.
Codecov Report
@@ Coverage Diff @@
## master #22129 +/- ##
==========================================
+ Coverage 66.97% 66.98% +0.01%
==========================================
Files 1832 1832
Lines 69905 69918 +13
Branches 7570 7570
==========================================
+ Hits 46820 46838 +18
+ Misses 21127 21122 -5
Partials 1958 1958
Flags with carried forward coverage won't be shown. Click here to find out more.
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
10b1bd1
to
c810cb5
Compare
c810cb5
to
8fdb22c
Compare
if self.database_id and ( | ||
not self.database or self.database.id != self.database_id | ||
): | ||
self.database = session.query(Database).filter_by(id=self.database_id).one() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're adding the database to the model here during flush, so removing this is what caused some issues for existing code that relied on this side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
(cherry picked from commit 6f6cb18)
SUMMARY
For the SIP 68 work, we were adding the SqlaTable dataset to the session during the shadow write process. Removing the dual write functionality impacted other unrelated SqlaTable instances that were trying to access the databases during different states of flush. For now, I'm putting back the current functionality until we can look into all of the edge cases here.
Original revert PR: #21986
TESTING INSTRUCTIONS
ADDITIONAL INFORMATION