Skip to content

Commit

Permalink
Fix issues around % signs and Presto (#2755)
Browse files Browse the repository at this point in the history
* Fix issues around % signs and Presto

* Fix mysql
  • Loading branch information
mistercrunch authored May 12, 2017
1 parent 91d951a commit 38375be
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def get_git_sha():
'pandas==0.19.2',
'parsedatetime==2.0.0',
'pydruid==0.3.1',
'PyHive>=0.2.1',
'PyHive>=0.3.0',
'python-dateutil==2.6.0',
'requests==2.13.0',
'simplejson==3.10.0',
Expand Down
4 changes: 1 addition & 3 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -542,14 +542,12 @@ def get_sqla_query( # sqla

def query(self, query_obj):
qry_start_dttm = datetime.now()
engine = self.database.get_sqla_engine()
qry = self.get_sqla_query(**query_obj)
sql = self.get_query_str(query_obj)
status = QueryStatus.SUCCESS
error_message = None
df = None
try:
df = pd.read_sql_query(qry, con=engine)
df = self.database.get_df(sql, self.schema)
except Exception as e:
status = QueryStatus.FAILED
logging.exception(e)
Expand Down
2 changes: 2 additions & 0 deletions superset/db_engine_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,7 @@ def get_table_names(cls, schema, inspector):

class MySQLEngineSpec(BaseEngineSpec):
engine = 'mysql'
cursor_execute_kwargs = {'args': {}}
time_grains = (
Grain('Time Column', _('Time Column'), '{col}'),
Grain("second", _('second'), "DATE_ADD(DATE({col}), "
Expand Down Expand Up @@ -355,6 +356,7 @@ def epoch_to_dttm(cls):

class PrestoEngineSpec(BaseEngineSpec):
engine = 'presto'
cursor_execute_kwargs = {'parameters': None}

time_grains = (
Grain('Time Column', _('Time Column'), '{col}'),
Expand Down

0 comments on commit 38375be

Please sign in to comment.