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 2018/06/13 07:27:06 UTC
[GitHub] mistercrunch commented on a change in pull request #5178: [sql]
Correct SQL parameter formatting
mistercrunch commented on a change in pull request #5178: [sql] Correct SQL parameter formatting
URL: https://github.com/apache/incubator-superset/pull/5178#discussion_r194979538
##########
File path: superset/models/core.py
##########
@@ -706,15 +703,36 @@ def needs_conversion(df_series):
return True
return False
- for k, v in df.dtypes.items():
- if v.type == numpy.object_ and needs_conversion(df[k]):
- df[k] = df[k].apply(utils.json_dumps_w_dates)
- return df
+ with closing(engine.raw_connection()) as conn:
+ with closing(conn.cursor()) as cursor:
+ for sql in sqls:
+ cursor.execute(sql, **self.db_engine_spec.cursor_execute_kwargs)
Review comment:
Hmm yeah looks like this won't work. The `async=True` is to get the progress bar. Some options:
* Make `db_engine_spec.handle_cursor` broader as in an `execute` method that returns the last recordset or dataframe. This means moving a fair amount of logic from SQL Lab and explore into db_engine_spec. It's probably the right thing to do.
* hacks around intercepting and disabling async when in explore/dashboard, but not in SQL Lab. That's more hacky but less disruptive
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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