When copying data with DbToDbOperator using a query, if the query provided by the user ends in a comment line, the query_first_row function will break with a syntax error, because the closing parenthesis will be inserted inside the comment.
Proposed solution: add a newline before and after the original query, when wrapping the original query as a subquery.