mistercrunch commented on issue #12028:
URL: 
https://github.com/apache/incubator-superset/issues/12028#issuecomment-744100489


   I see this stacktrace, meaning there's probably bad error handling. It 
should show `Unexpected Error` instead of `No data` here.
   
   ```bash
   DEBUG:superset.models.core:Database.get_sqla_engine(). Masked URL: 
mysql://root@localhost/examples?charset=utf8
   INFO:superset.connectors.sqla.models:SELECT ds AS ds, gender AS gender, name 
AS name, num AS num, state AS state, sum_boys AS sum_boys, sum_girls AS 
sum_girls, CASE WHEN state = 'CA' THEN num ELSE 0 END AS num_california
   FROM birth_names
   WHERE ds >= STR_TO_DATE('1920-12-13 00:00:00.000000', '%Y-%m-%d 
%H:%i:%s.%f') AND ds < STR_TO_DATE('2020-12-13 16:36:40.000000', '%Y-%m-%d 
%H:%i:%s.%f') AND gender = 'boy' ORDER BY sum(num) DESC
    LIMIT 1000
   WARNING:superset.connectors.sqla.models:Query SELECT ds AS ds,
          gender AS gender,
          name AS name,
          num AS num,
          state AS state,
          sum_boys AS sum_boys,
          sum_girls AS sum_girls,
          CASE
              WHEN state = 'CA' THEN num
              ELSE 0
          END AS num_california
   FROM birth_names
   WHERE ds >= STR_TO_DATE('1920-12-13 00:00:00.000000', '%Y-%m-%d %H:%i:%s.%f')
     AND ds < STR_TO_DATE('2020-12-13 16:36:40.000000', '%Y-%m-%d %H:%i:%s.%f')
     AND gender = 'boy'
   ORDER BY sum(num) DESC
   LIMIT 1000 on schema None failed
   Traceback (most recent call last):
     File "/Users/max/code/superset/superset/connectors/sqla/models.py", line 
1314, in query
       df = self.database.get_df(sql, self.schema, mutator)
     File "/Users/max/code/superset/superset/models/core.py", line 393, in 
get_df
       self.db_engine_spec.execute(cursor, sqls[-1])
     File "/Users/max/code/superset/superset/db_engine_specs/base.py", line 
891, in execute
       cursor.execute(query)
     File 
"/Users/max/.pyenv/versions/3.7.7/envs/env37/lib/python3.7/site-packages/MySQLdb/cursors.py",
 line 206, in execute
       res = self._query(query)
     File 
"/Users/max/.pyenv/versions/3.7.7/envs/env37/lib/python3.7/site-packages/MySQLdb/cursors.py",
 line 312, in _query
       db.query(q)
     File 
"/Users/max/.pyenv/versions/3.7.7/envs/env37/lib/python3.7/site-packages/MySQLdb/connections.py",
 line 224, in query
       _mysql.connection.query(self, query)
   MySQLdb._exceptions.OperationalError: (3029, 'Expression #1 of ORDER BY 
contains aggregate function and applies to the result of a non-aggregated 
query')
   ```


----------------------------------------------------------------
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:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to