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 2019/11/14 20:06:59 UTC

[GitHub] [incubator-superset] john-bodley commented on a change in pull request #8561: [fix] csv upload param formatting in create engine

john-bodley commented on a change in pull request #8561: [fix] csv upload param formatting in create engine
URL: https://github.com/apache/incubator-superset/pull/8561#discussion_r346521281
 
 

 ##########
 File path: superset/db_engine_specs/base.py
 ##########
 @@ -387,6 +387,19 @@ def df_to_sql(cls, df: pd.DataFrame, **kwargs):  # pylint: disable=invalid-name
         """
         df.to_sql(**kwargs)
 
+    @classmethod
+    def dialect_paramstyle(cls, sqla_uri: str) -> Optional[str]:
+        """
+        Specify a paramstyle for certain dialects. Using the default param
+        style for certain drivers causes issues when special characters, eg (,(,%
+        are used in values.
+        """
+        dialect = ""
+        matches = re.search(r"^([^:+]+)[:+]", sqla_uri, re.IGNORECASE)
 
 Review comment:
   SQLALchemy has a [`make_url`](https://docs.sqlalchemy.org/en/13/core/engines.html#sqlalchemy.engine.url.make_url) method which returns a URL object from which the dialect can be obtained via `get_dialect()`. No regex required. 

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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