def has_index(self, columns):
        """Check if an index exists to cover the given ``columns``."""
        if not self.exists:
            return False
        columns = set([normalize_column_name(c) for c in columns])
        if columns in self._indexes:
            return True
        for column in columns:
            if not self.has_column(column):
                return False
        indexes = self.db.inspect.get_indexes(self.name, schema=self.db.schema)
        for index in indexes:
            if columns == set(index.get('column_names', [])):
                self._indexes.append(columns)
                return True
        return False
def has_index ( self , columns ) : if not self . exists : return False columns = set ( [ normalize_column_name ( c ) for c in columns ] ) if columns in self . _indexes : return True for column in columns : if not self . has_column ( column ) : return False indexes = self . db . inspect . get_indexes ( self . name , schema = self . db . schema ) for index in indexes : if columns == set ( index . get ( 'column_names' , [ ] ) ) : self . _indexes . append ( columns ) return True return False
Check if an index exists to cover the given ``columns``.