justinpark commented on code in PR #23378:
URL: https://github.com/apache/superset/pull/23378#discussion_r1146683616
##########
superset-frontend/src/SqlLab/actions/sqlLab.js:
##########
@@ -331,6 +331,12 @@ export function fetchQueryResults(query, displayLimit) {
};
}
+export function cleanSqlComments(sql) {
+ if (!sql) return '';
+
+ return sql.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();
Review Comment:
@michael-s-molina that's intended.
As I mentioned above, `//` comment visually not recognized as comment-out
block so it doesn't sanitize the `//` comments.
<img width="465"
alt="fix_sqllab___throw_errors_of_commented_out_query_by_justinpark_·_Pull_Request__23378_·_apache_superset"
src="https://user-images.githubusercontent.com/1392866/227318793-3547b40d-6891-45ef-91e8-676a1db950c9.png">
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]