pabrahamusa opened a new issue #15065:
URL: https://github.com/apache/superset/issues/15065
A clear and concise description of what the bug is.
SuperSet is throwing following error while searching for saved query with
empty name selected
Sorry, something went wrong
500 - Internal Server Error
### Expected results
I expect the list of saved query to appear that belongs to everyone and not
an error page
### Actual results
Getting following error:
```
}
Sorry, something went wrong
500 - Internal Server Error
Stacktrace
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1277, in _execute_context
cursor, statement, parameters, context
File
"/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line
593, in do_execute
cursor.execute(statement, parameters)
psycopg2.errors.InvalidTextRepresentation: invalid input syntax for integer:
"__None"
LINE 3: WHERE ab_user.id = '__None'
^
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 2447, in
wsgi_app
response = self.full_dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1952, in
full_dispatch_request
rv = self.handle_user_exception(e)
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1821, in
handle_user_exception
reraise(exc_type, exc_value, tb)
File "/usr/local/lib/python3.7/site-packages/flask/_compat.py", line 39,
in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1950, in
full_dispatch_request
rv = self.dispatch_request()
File "/usr/local/lib/python3.7/site-packages/flask/app.py", line 1936, in
dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/security/decorators.py",
line 109, in wraps
return f(self, *args, **kwargs)
File "/app/superset/views/sql_lab.py", line 84, in list
return super().list()
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/security/decorators.py",
line 109, in wraps
return f(self, *args, **kwargs)
File "/usr/local/lib/python3.7/site-packages/flask_appbuilder/views.py",
line 551, in list
widgets = self._list()
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/baseviews.py", line
1127, in _list
page_size=page_size,
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/baseviews.py", line
1026, in _get_list_widget
page_size=page_size,
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py",
line 425, in query
count = self.query_count(query, filters, select_columns)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py",
line 347, in query_count
query, filters, select_columns=select_columns, aliases_mapping={}
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py",
line 332, in _apply_inner_all
query = self.apply_filters(query, inner_filters)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py",
line 187, in apply_filters
return filters.apply_all(query)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/filters.py",
line 295, in apply_all
query = flt.apply(query, value)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/filters.py",
line 188, in apply
rel_obj = self.datamodel.get_related_obj(self.column_name, value)
File
"/usr/local/lib/python3.7/site-packages/flask_appbuilder/models/sqla/interface.py",
line 807, in get_related_obj
return self.session.query(rel_model).get(value)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 1018, in get
return self._get_impl(ident, loading.load_on_pk_identity)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 1135, in _get_impl
return db_load_fn(self, primary_key_identity)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/loading.py",
line 286, in load_on_pk_identity
return q.one()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 3490, in one
ret = self.one_or_none()
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 3459, in one_or_none
ret = list(self)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 3535, in __iter__
return self._execute_and_instances(context)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/orm/query.py",
line 3560, in _execute_and_instances
result = conn.execute(querycontext.statement, self._params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1011, in execute
return meth(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/sql/elements.py",
line 298, in _execute_on_connection
return connection._execute_clauseelement(self, multiparams, params)
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1130, in _execute_clauseelement
distilled_params,
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1317, in _execute_context
e, statement, parameters, cursor, context
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1511, in _handle_dbapi_exception
sqlalchemy_exception, with_traceback=exc_info[2], from_=e
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/util/compat.py",
line 182, in raise_
raise exception
File "/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/base.py",
line 1277, in _execute_context
cursor, statement, parameters, context
File
"/usr/local/lib/python3.7/site-packages/sqlalchemy/engine/default.py", line
593, in do_execute
cursor.execute(statement, parameters)
sqlalchemy.exc.DataError: (psycopg2.errors.InvalidTextRepresentation)
invalid input syntax for integer: "__None"
LINE 3: WHERE ab_user.id = '__None'
^
[SQL: SELECT ab_user.id AS ab_user_id, ab_user.first_name AS
ab_user_first_name, ab_user.last_name AS ab_user_last_name, ab_user.username AS
ab_user_username, ab_user.password AS ab_user_password, ab_user.active AS
ab_user_active, ab_user.email AS ab_user_email, ab_user.last_login AS
ab_user_last_login, ab_user.login_count AS ab_user_login_count,
ab_user.fail_login_count AS ab_user_fail_login_count, ab_user.created_on AS
ab_user_created_on, ab_user.changed_on AS ab_user_changed_on,
ab_user.created_by_fk AS ab_user_created_by_fk, ab_user.changed_by_fk AS
ab_user_changed_by_fk
FROM ab_user
WHERE ab_user.id = %(param_1)s]
[parameters: {'param_1': '__None'}]
(Background on this error at: http://sqlalche.me/e/13/9h9h)
```
#### Screenshots
Attached below
#### How to reproduce the bug
To reproduce :
a) Go to SQLLab Saved Quries:

b) Select 'No Relation' from the first drop down:

c) Select blank or empty user from the second drop down:

d) Click Search and the error will be displayed:

### Environment
(please complete the following information):
- superset version: `superset version`
- This is the latest 1.0 version in docker
```
root@sb-superset-58448dc85c-dmvgc:/app# superset version
Loaded your LOCAL configuration at [/app/pythonpath/superset_config.py]
logging was configured successfully
INFO:superset.utils.logging_configurator:logging was configured successfully
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Superset 0.999.0dev
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
```
- python version: `python --version`
```
root@sb-superset-58448dc85c-dmvgc:/app# python --version
Python 3.7.9
```
- node.js version: `node -v`
--
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]