SQLAlchemy - InsertFromSelect with columns support
columns.append(compiler.process(column, asfrom=True))


should be simply

columns.append(column.name)


and

table = compiler.process(element.insert_spec[0].table)


should be

table = compiler.process(element.insert_spec[0].table, asfrom=True)