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/07 15:59:45 UTC

[GitHub] [superset] betodealmeida commented on a change in pull request #17881: fix(sql): missing quotes in sql

betodealmeida commented on a change in pull request #17881:
URL: https://github.com/apache/superset/pull/17881#discussion_r780358546



##########
File path: superset/connectors/base/models.py
##########
@@ -396,7 +397,11 @@ def handle_single_value(value: Optional[FilterValue]) -> Optional[FilterValue]:
             ):
                 return datetime.utcfromtimestamp(value / 1000)
             if isinstance(value, str):
-                value = value.strip("\t\n'\"")
+                value = value.strip("\t\n")
+
+                quotes_value = re.findall(r"['|\"](.*?)['|\"]", value)
+                if len(quotes_value) == 1 and quotes_value[0] == value.strip("'\""):
+                    value = value.strip("'\"")

Review comment:
       Do we have any context on **why** we're stripping these quotes?
   
   If the user typed quotes in the filter they should be passed as-is, and possibly escaped by the dialect if needed.
   
   I think we should remove the quote stripping here, and if it breaks other things we should fix those things instead.




-- 
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