def get_unique_constraints(table, context):
 list_of_constraints = []
 for contraint in table.constraints:
  if isinstance(contraint, sqlalchemy.UniqueConstraint):
   columns = [column.name for column in contraint.columns]
   list_of_constraints.append(columns)
 return list_of_constraints

def get_unique_constraints ( table , context ) : list_of_constraints = [ ] for contraint in table . constraints : if isinstance ( contraint , sqlalchemy . UniqueConstraint ) : columns = [ column . name for column in contraint . columns ] list_of_constraints . append ( columns ) return list_of_constraints
get a list of unique constraints for a sqlalchemy table .