def _assemble_with_columns(self, sql_str, columns, *args, **kwargs):
<EOL>qcols = []<EOL>for col in columns:<EOL><INDENT>if '<STR_LIT:.>' in col:<EOL><INDENT>wlist = col.split('<STR_LIT:.>')<EOL>qcols.append(sql.SQL('<STR_LIT:.>').join([sql.Identifier(x) for x in wlist]))<EOL><DEDENT>else:<EOL><INDENT>qcols.append(sql.Identifier(col))<EOL><DEDENT><DEDENT>query_string = sql.SQL(sql_str).format(<EOL>sql.SQL('<STR_LIT:U+002CU+0020>').join(qcols),<EOL>*[sql.Literal(a) for a in args]<EOL>)<EOL>return query_string<EOL>
Format a select statement with specific columns 

:sql_str:   An SQL string template
:columns:   The columns to be selected and put into {0}
:*args:     Arguments to use as query parameters.
:returns:   Psycopg2 compiled query