korridor opened a new issue #11706: URL: https://github.com/apache/incubator-superset/issues/11706
I do not get a real error message when I try to import a table definition for an empty or a non-existing table. ### Expected results I expected an english error message, that describes the problem. ### Actual results I got the following error message: "'table'" (See screenshot) #### Screenshots <img width="1299" alt="Screenshot 2020-11-12 at 14 56 06" src="https://user-images.githubusercontent.com/26689068/99186502-f7037d00-2750-11eb-834c-247ff7eeee4c.png"> #### How to reproduce the bug 1. Go to Sources -> Tables in Nav bar 2. Click on + (Add new record) 3. Choose database and name of an empty table or non-existing table 4. See error in screenshots ### Environment I am using the following docker image: [https://hub.docker.com/r/amancevice/superset/](https://hub.docker.com/r/amancevice/superset/) - superset version: `0.37.2` - python version: `3.6.12` - node.js version: `?` ### Checklist - [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 **Logs for importing empty table** ``` Got an error in pre_add for bi.empty_table Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/superset/views/base.py", line 213, in validate_sqlatable table.get_sqla_table_object() File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 1240, in get_sqla_table_object return self.database.get_table(self.table_name, schema=self.schema) File "/usr/local/lib/python3.6/site-packages/superset/models/core.py", line 611, in get_table autoload_with=self.get_sqla_engine(), File "<string>", line 2, in __new__ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned return fn(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 560, in __new__ metadata._remove_table(name, schema) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__ exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 555, in __new__ table._init(name, metadata, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 649, in _init resolve_fks=resolve_fks, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 673, in _autoload _extend_on=_extend_on, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2214, in run_callable return conn.run_callable(callable_, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1653, in run_callable return callable_(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in reflecttable table, include_columns, exclude_columns, resolve_fks, **opts File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 679, in reflecttable raise exc.NoSuchTableError(table.name) sqlalchemy.exc.NoSuchTableError: empty_table ERROR:superset.views.base:Got an error in pre_add for bi.empty_table Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/superset/views/base.py", line 213, in validate_sqlatable table.get_sqla_table_object() File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 1240, in get_sqla_table_object return self.database.get_table(self.table_name, schema=self.schema) File "/usr/local/lib/python3.6/site-packages/superset/models/core.py", line 611, in get_table autoload_with=self.get_sqla_engine(), File "<string>", line 2, in __new__ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned return fn(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 560, in __new__ metadata._remove_table(name, schema) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__ exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 555, in __new__ table._init(name, metadata, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 649, in _init resolve_fks=resolve_fks, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 673, in _autoload _extend_on=_extend_on, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2214, in run_callable return conn.run_callable(callable_, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1653, in run_callable return callable_(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in reflecttable table, include_columns, exclude_columns, resolve_fks, **opts File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 679, in reflecttable raise exc.NoSuchTableError(table.name) sqlalchemy.exc.NoSuchTableError: empty_table ``` **Logs for importing non-existing table** ``` Got an error in pre_add for bi.random Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/superset/views/base.py", line 213, in validate_sqlatable table.get_sqla_table_object() File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 1240, in get_sqla_table_object return self.database.get_table(self.table_name, schema=self.schema) File "/usr/local/lib/python3.6/site-packages/superset/models/core.py", line 611, in get_table autoload_with=self.get_sqla_engine(), File "<string>", line 2, in __new__ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned return fn(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 560, in __new__ metadata._remove_table(name, schema) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__ exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 555, in __new__ table._init(name, metadata, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 649, in _init resolve_fks=resolve_fks, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 673, in _autoload _extend_on=_extend_on, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2214, in run_callable return conn.run_callable(callable_, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1653, in run_callable return callable_(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in reflecttable table, include_columns, exclude_columns, resolve_fks, **opts File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 666, in reflecttable table_name, schema, **table.dialect_kwargs File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 392, in get_columns self.bind, table_name, schema, info_cache=self.info_cache, **kw File "<string>", line 2, in get_columns File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 52, in cache ret = fn(self, con, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2938, in get_columns connection, table_name, schema, info_cache=kw.get("info_cache") File "<string>", line 2, in get_table_oid File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 52, in cache ret = fn(self, con, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2852, in get_table_oid raise exc.NoSuchTableError(table_name) sqlalchemy.exc.NoSuchTableError: random ERROR:superset.views.base:Got an error in pre_add for bi.random Traceback (most recent call last): File "/usr/local/lib/python3.6/site-packages/superset/views/base.py", line 213, in validate_sqlatable table.get_sqla_table_object() File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 1240, in get_sqla_table_object return self.database.get_table(self.table_name, schema=self.schema) File "/usr/local/lib/python3.6/site-packages/superset/models/core.py", line 611, in get_table autoload_with=self.get_sqla_engine(), File "<string>", line 2, in __new__ File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned return fn(*args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 560, in __new__ metadata._remove_table(name, schema) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 69, in __exit__ exc_value, with_traceback=exc_tb, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 555, in __new__ table._init(name, metadata, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 649, in _init resolve_fks=resolve_fks, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 673, in _autoload _extend_on=_extend_on, File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2214, in run_callable return conn.run_callable(callable_, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1653, in run_callable return callable_(self, *args, **kwargs) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 470, in reflecttable table, include_columns, exclude_columns, resolve_fks, **opts File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 666, in reflecttable table_name, schema, **table.dialect_kwargs File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 392, in get_columns self.bind, table_name, schema, info_cache=self.info_cache, **kw File "<string>", line 2, in get_columns File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 52, in cache ret = fn(self, con, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2938, in get_columns connection, table_name, schema, info_cache=kw.get("info_cache") File "<string>", line 2, in get_table_oid File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 52, in cache ret = fn(self, con, *args, **kw) File "/usr/local/lib/python3.6/site-packages/sqlalchemy/dialects/postgresql/base.py", line 2852, in get_table_oid raise exc.NoSuchTableError(table_name) sqlalchemy.exc.NoSuchTableError: random ``` ---------------------------------------------------------------- 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]
