Because the type of the query was generated by sqlalchemy.sql.text(),
the TextClause object did not have a split() method, and crashed out
trying to reformat into one line. Using the str() wrapper provides a
string that can be properly split and joined.
Change-Id: I1ed9e39d7ebf3904d3d233330ee57082ad02c5f3