mikebridge commented on PR #44015: URL: https://github.com/apache/superset/pull/44015#issuecomment-5591943258
Follow-up fix pushed (`253d432fa1`): the locking re-read broke the restore path on Postgres — `query(Slice)...with_for_update()` triggers the `lazy="subquery"` eager loader on `Slice.table`, which emits `SELECT DISTINCT … FOR UPDATE` to load the related rows, and Postgres rejects `FOR UPDATE` with `DISTINCT`. Fixed with `.enable_eagerloads(False)` on the locking query (we only need the locked row's own columns; relationships load lazily after). Verified against real Postgres — pre-fix raises `FOR UPDATE is not allowed with DISTINCT clause`, post-fix returns the row. The mocked unit tests couldn't catch it (the DISTINCT SQL is generated by the subquery loader at execution against Postgres, not at compile time); the test-postgres integration leg is the guard and now covers it. CI re-running. -- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
