john-bodley commented on a change in pull request #15807:
URL: https://github.com/apache/superset/pull/15807#discussion_r674172137
##########
File path: superset/migrations/versions/49b5a32daba5_add_report_schedules.py
##########
@@ -119,13 +120,17 @@ def upgrade():
)
+def has_unique_constraint(constraint_name: str, table_name: str) -> bool:
+ bind = op.get_bind()
+ inspector = Inspector.from_engine(bind)
+ unique_constraints = inspector.get_unique_constraints(table_name)
+ return constraint_name in {constraint["name"] for constraint in
unique_constraints}
Review comment:
@betodealmeida it seems like we have similar logic like this
[elsewhere](https://github.com/apache/superset/blob/62a8f2e193da3bdf1f43be085b5814be3dd476fa/superset/utils/core.py#L675-L684).
--
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]