superset icon indicating copy to clipboard operation
superset copied to clipboard

Exception: 'Query' object has no attribute 'status'

Open hungrytortoise opened this issue 9 years ago • 10 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

the lastest version

Expected results

image when i clicked query btn ,it worked normally. however, when i change my sql like the picture shows,it does not work .

Actual results

image

Steps to reproduce

how to fix that. thanks

hungrytortoise avatar Apr 19 '17 07:04 hungrytortoise

image and when i done same sql query in same table,it could show correct results.

hungrytortoise avatar Apr 19 '17 07:04 hungrytortoise

tip: table student is a hive table,when i do same sql query in a mysql table,it is norml too.

hungrytortoise avatar Apr 19 '17 07:04 hungrytortoise

Any stacktrace in the logs? Which version of superset is this?

xrmx avatar Apr 20 '17 07:04 xrmx

@xrmx , I met the same error, some logs below.

2017-04-20 16:16:42,600:INFO:pyhive.hive:SELECT tlh.visitdate, count(distinct tlh.useruid) cnt_user FROM bo.t_log_hive tlh group by tlh.visitdate 2017-04-20 16:16:42,600:DEBUG:pyhive.hive:TExecuteStatementReq(confOverlay=None, sessionHandle=TSessionHandle(sessionId=THandleIdentifier(secret='=\x8eYLt;@q\x86z\x96H\xf5\xc3\x14\xb0', guid='\xdf\xaf\x04\xaf\xfe\xe3B\xfc\x8e\x81\x1d;2\xaaI\xd2')), runAsync=True, statement='SELECT tlh.visitdate, count(distinct tlh.useruid) cnt_user\n FROM bo.t_log_hive tlh\n group by tlh.visitdate') 2017-04-20 16:16:42,684:DEBUG:pyhive.hive:TExecuteStatementResp(status=TStatus(errorCode=None, errorMessage=None, sqlState=None, infoMessages=None, statusCode=0), operationHandle=TOperationHandle(hasResultSet=True, modifiedRowCount=None, operationType=0, operationId=THandleIdentifier(secret='\r\xc0\x16\x9c,\xe9N\x83\x8a\x90\x81so4=N', guid='vvV\x818\xb2H\x1e\x86\xa1]\x0c\xf0\xaa[\xce'))) 2017-04-20 16:16:42,685:INFO:root:Handling cursor 2017-04-20 16:16:47,691:DEBUG:pyhive.hive:TGetOperationStatusResp(status=TStatus(errorCode=None, errorMessage=None, sqlState=None, infoMessages=None, statusCode=0), operationState=1, errorMessage=None, sqlState=None, errorCode=None) 2017-04-20 16:16:47,692:ERROR:root:'Query' object has no attribute 'status' Traceback (most recent call last): File "/opt/python/python2.7.13/lib/python2.7/site-packages/superset/sql_lab.py", line 138, in get_sql_results db_engine_spec.handle_cursor(cursor, query, session) File "/opt/python/python2.7.13/lib/python2.7/site-packages/superset/db_engine_specs.py", line 642, in handle_cursor if query.status == QueryStatus.STOPPED: AttributeError: 'Query' object has no attribute 'status' 2017-04-20 16:16:47,720:ERROR:root:'Query' object has no attribute 'status' Traceback (most recent call last): File "/opt/python/python2.7.13/lib/python2.7/site-packages/superset/views/core.py", line 1994, in sql_json query_id=query_id, return_results=True) File "/opt/python/python2.7.13/lib/python2.7/site-packages/celery/local.py", line 188, in call return self._get_current_object()(*a, **kw) File "/opt/python/python2.7.13/lib/python2.7/site-packages/celery/app/task.py", line 420, in call return self.run(*args, **kwargs) File "/opt/python/python2.7.13/lib/python2.7/site-packages/superset/sql_lab.py", line 144, in get_sql_results handle_error(db_engine_spec.extract_error_message(e)) File "/opt/python/python2.7.13/lib/python2.7/site-packages/superset/sql_lab.py", line 78, in handle_error raise Exception(query.error_message) Exception: 'Query' object has no attribute 'status'

panhuida avatar Apr 20 '17 08:04 panhuida

@xrmx my superset version is 0.17.4
by the way,my friend met the same problem just now.

hungrytortoise avatar Apr 20 '17 10:04 hungrytortoise

could u help me deal with that @xrmx

hungrytortoise avatar Apr 21 '17 03:04 hungrytortoise

Looks like a missing superset db upgrade, could you please try that?

xrmx avatar Apr 22 '17 13:04 xrmx

i upgrade superset to 0.17.5 ,but problem still exists. @xrmx

hungrytortoise avatar Apr 25 '17 04:04 hungrytortoise

Even I am getting the same error @xrmx with superset-0.17.5

santhavathi avatar Apr 25 '17 13:04 santhavathi

@xrmx, will this be fixed anytime soon?

santhavathi avatar Apr 29 '17 03:04 santhavathi