michael-s-molina commented on code in PR #23378:
URL: https://github.com/apache/superset/pull/23378#discussion_r1140258523
##########
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:
```suggestion
// group 1 -> /* */
// group 2 -> //
// group 3 -> --
return sql.replace(/(\/\*[^*]*\*\/)|(\/\/[^*]*)|(--[^.].*)/gm, '').trim();
```
##########
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:
`select *` queries are only supported by double dashes. I'm not sure if you
want to support them for other comment types.
<img width="439" alt="Screenshot 2023-03-17 at 10 43 33"
src="https://user-images.githubusercontent.com/70410625/225923017-5d4556d8-1d27-4a4e-8b4d-e49a259d2a6b.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]