mikebridge commented on PR #40128: URL: https://github.com/apache/superset/pull/40128#issuecomment-4614341945
Quick follow-up: added a Postgres / MySQL 8.0.13+ regression test in `f4b902a467` (+ small mypy fixup `8af57a9f99`) — `TestDashboardRestore.test_restore_via_import_with_slug_rename`. It captures the exact scenario from Richard's review: 1. Create dashboard A with `slug="old"` 2. Soft-delete A 3. Create dashboard B with `slug="old"` (only succeeds on partial-index dialects, where the slug is free during the soft-deleted window) 4. Re-import A's UUID with a v1 config that changes the slug to a free value 5. Assert A is restored with the new slug, `deleted_at=None`, and B unchanged If anyone later removes the `if "slug" in config: existing.slug = config["slug"]` line before the flush in `commands/dashboard/importers/v1/utils.py`, step 4 fails with a partial-index unique-violation at the row's stale old slug. The assertion error message names the fix's file + mechanism so the regression is unambiguous from the test output. Gated via `_skip_if_no_partial_index()` because the fallback dialects can't reach the conflict state at step 3 (the full unique constraint blocks B's create before the test can set up the scenario). -- 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]
