eschutho opened a new pull request, #20460: URL: https://github.com/apache/superset/pull/20460
Follow up to https://github.com/apache/superset/pull/20351 where I added some extra checks and lookups for when a column lookup returned `None` on dual write. We're still seeing incidents of the same error: `psycopg2.errors.UniqueViolation: duplicate key value violates unique constraint "sl_columns_uuid_key"` intermittently and I was able to repro again in a test when adding in an additional query on the session for existing columns. It seems that the query is triggering an autoflush which is attempting to create a new column when one already exists. I added a `no-flush` flag onto any newColumn queries and also made sure to pull in the id of any existing columns when updating it and adding it to the session so that SqlAlchemy will treat it as an update instead of a write. ### TESTING INSTRUCTIONS More unit tests, because we don't have a reliable way to repro this issue. But regression testing is necessary. Most issues are happening on import when the dataset already exists and is being overwritten, but for regression, thorough testing of editing and importing datasets that either do or do not exist would be needed. ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Required feature flags: - [ ] Changes UI - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351)) - [ ] Migration is atomic, supports rollback & is backwards-compatible - [ ] Confirm DB migration upgrade and downgrade tested - [ ] Runtime estimates and downtime expectations provided - [ ] Introduces new feature or API - [ ] Removes existing feature or API -- 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]
