You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2022/01/11 08:34:35 UTC

[GitHub] [superset] villebro commented on a change in pull request #17995: fix: Workaround for sqlparse issue #652

villebro commented on a change in pull request #17995:
URL: https://github.com/apache/superset/pull/17995#discussion_r781850188



##########
File path: superset/sql_parse.py
##########
@@ -41,6 +42,16 @@
 logger = logging.getLogger(__name__)
 
 
+# Workaround for https://github.com/andialbrecht/sqlparse/issues/652.
+sqlparse.keywords.SQL_REGEX.insert(
+    0,
+    (
+        re.compile(r"'(''|\\\\|\\|[^'])*'", re.IGNORECASE | re.UNICODE).match,

Review comment:
       Just in case, can we use the default flags from `sqlparse` to make sure the compiled regex is in line with those in the library, something like
   ```suggestion
           re.compile(r"'(''|\\\\|\\|[^'])*'", sqlparse.keywords.FLAGS).match,
   ```
   

##########
File path: superset/sql_parse.py
##########
@@ -41,6 +42,16 @@
 logger = logging.getLogger(__name__)
 
 
+# Workaround for https://github.com/andialbrecht/sqlparse/issues/652.

Review comment:
       Could we add a `TODO:` here to remove when this is fixed upstream and also add a comment in `setup.py` where the version is pinned to remove this if it's been fixed?




-- 
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: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org