superset icon indicating copy to clipboard operation
superset copied to clipboard

'NoneType' object is not callable - when performing query on trino database

Open fabioaraujopt opened this issue 3 years ago • 2 comments

When performing the update to version 1.4.0 from version 1.3.0, the queries stop working with 'NoneType' object is not callable error. This also happens with version 2.0 and 1.5.0.

How to reproduce the bug

  1. Go to 'https://superset.cilabs.com/superset/sqllab' (query lab)
  2. Fill the dataset with a standard query
  3. Click "RUN"
  4. See error

Expected results

Query results should appear as normal query.

Actual results

UI shows:

Trino Error
'NoneType' object is not callable


This may be triggered by:
Issue 1002 - The database returned an unexpected error. 

See less

Logs show:

2022-07-19 14:05:50,063:WARNING:superset.views.base:[SupersetError(message="'NoneType' object is not callable", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]
Traceback (most recent call last):
  File "/app/superset/views/base.py", line 203, in wraps
    return f(self, *args, **kwargs)
  File "/app/superset/utils/log.py", line 242, in wrapper
    value = f(*args, **kwargs)
  File "/app/superset/views/core.py", line 2462, in sql_json
    command_result: CommandResult = command.run()
  File "/app/superset/sqllab/command.py", line 104, in run
    raise ex
  File "/app/superset/sqllab/command.py", line 96, in run
    status = self._run_sql_json_exec_from_scratch()
  File "/app/superset/sqllab/command.py", line 138, in _run_sql_json_exec_from_scratch
    raise ex
  File "/app/superset/sqllab/command.py", line 133, in _run_sql_json_exec_from_scratch
    return self._sql_json_executor.execute(
  File "/app/superset/sqllab/sql_json_executer.py", line 111, in execute
    raise SupersetErrorsException(
superset.exceptions.SupersetErrorsException: [SupersetError(message="'NoneType' object is not callable", error_type=<SupersetErrorType.GENERIC_DB_ENGINE_ERROR: 'GENERIC_DB_ENGINE_ERROR'>, level=<ErrorLevel.ERROR: 'error'>, extra={'engine_name': 'Trino', 'issue_codes': [{'code': 1002, 'message': 'Issue 1002 - The database returned an unexpected error.'}]})]

Environment

(please complete the following information):

  • superset version: superset version
superset --version
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
Python 3.8.12
Flask 1.1.4
Werkzeug 1.0.1
  • python version: python --version: Python 3.8.12

Checklist

Make sure to follow these steps before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if there are 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.

Additional context

Add any other context about the problem here.

fabioaraujopt avatar Jul 19 '22 14:07 fabioaraujopt

@fabioaraujopt we are also facing this issue in our version of 1.5.1 superset, we're upgrading to 2.0 soon and will report back with if we are still facing it. Have you discovered any sort of root cause to the bug?

willcrain1 avatar Aug 03 '22 14:08 willcrain1

Hello, I had this issue in 1.5.1, it might be correlated to your issue. However it should work in 1.5.0

https://github.com/apache/superset/issues/20428

Thelin90 avatar Aug 03 '22 19:08 Thelin90

Updating to 2.0 and updating our config parameters to the one specified in this file fixed the issue for us - https://github.com/apache/superset/blob/master/superset/config.py @Thelin90 @fabioaraujopt

willcrain1 avatar Aug 15 '22 14:08 willcrain1

Closing this since it sounds like it was fixed in 2.0, and we're on the verge of 4.0 now :) Please open a new/updated issue if warranted. Thanks!

rusackas avatar Feb 12 '24 19:02 rusackas