mikebridge commented on PR #40128:
URL: https://github.com/apache/superset/pull/40128#issuecomment-4663796589

   @richardfogaca — good catch, addressed in 4c46eb896e.
   
   Dropping `unique=True` from `Dashboard.slug` (the full unique constraint 
became a partial active-only index for soft-delete) did remove `slug` from 
`ImportExportMixin._unique_constraints`, so a different-UUID / same-slug import 
would fall through to an insert and collide on the partial active-slug index at 
flush.
   
   Fix: overrode `Dashboard._unique_constraints()` to re-add `{"slug"}` as an 
import identity key while keeping DB-level uniqueness partial. Import again 
matches-and-updates an existing active dashboard by slug (the pre-soft-delete 
behaviour); a `NULL` slug is skipped by the importer's filter builder, so this 
only adds a real lookup when the config carries a slug. Added regression tests 
(`test_dashboard_unique_constraints_includes_slug`, 
`test_dashboard_import_matches_existing_active_by_slug`).
   


-- 
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]

Reply via email to