Does not work with clickhouse source. Cannot create a dataset
See original GitHub issueUpdated as stated here https://superset.apache.org/docs/databases/clickhouse
How to reproduce the bug
- Followed instructions.
- Connected to database succesfully
- Was able to connect and get dataset from other tools
- Failed with adding dataset using superset
- Tried to clickhouse-sqlalchemy and sqlalchemy-clickhouse didn’t help
Expected results
Working dataset
Actual results
2021-10-05 19:35:02,803:DEBUG:clickhouse_driver.connection:Connecting. Database: default. User: labuser5 2021-10-05 19:35:02,804:DEBUG:clickhouse_driver.connection:Connecting to 10.11.12.13:9000 2021-10-05 19:35:02,807:DEBUG:clickhouse_driver.connection:Connected to ClickHouse server version 18.16.1, revision: 54412 2021-10-05 19:35:02,808:DEBUG:clickhouse_driver.connection:Query: select version() 2021-10-05 19:35:02,809:DEBUG:clickhouse_driver.connection:Block "" send time: 0.000187 2021-10-05 19:35:02,812:DEBUG:clickhouse_driver.connection:Connecting. Database: default. User: labuser5 2021-10-05 19:35:02,812:DEBUG:clickhouse_driver.connection:Connecting to 10.11.12.13:9000 2021-10-05 19:35:02,814:DEBUG:clickhouse_driver.connection:Connected to ClickHouse server version 18.16.1, revision: 54412 2021-10-05 19:35:02,815:DEBUG:clickhouse_driver.connection:Query: DESCRIBE TABLE default.cell_towers 2021-10-05 19:35:02,815:DEBUG:clickhouse_driver.connection:Block "" send time: 0.000207 2021-10-05 19:35:02,818:ERROR:root:Invalid enum member name: Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/flask_appbuilder/api/__init__.py", line 85, in wraps return f(self, *args, **kwargs) File "/app/superset/views/base_api.py", line 85, in wraps raise ex File "/app/superset/views/base_api.py", line 82, in wraps duration, response = time_function(f, self, *args, **kwargs) File "/app/superset/utils/core.py", line 1461, in time_function response = func(*args, **kwargs) File "/app/superset/utils/log.py", line 242, in wrapper value = f(*args, **kwargs) File "/app/superset/datasets/api.py", line 252, in post new_model = CreateDatasetCommand(g.user, item).run() File "/app/superset/datasets/commands/create.py", line 46, in run self.validate() File "/app/superset/datasets/commands/create.py", line 86, in validate if database and not DatasetDAO.validate_table_exists( File "/app/superset/datasets/dao.py", line 81, in validate_table_exists database.get_table(table_name, schema=schema) File "/app/superset/models/core.py", line 645, in get_table return Table( File "<string>", line 2, in new File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/deprecations.py", line 139, in warned return fn(*args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 563, in new metadata._remove_table(name, schema) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/langhelpers.py", line 68, in exit compat.raise_( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 182, in raise_ raise exception File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 558, in new table._init(name, metadata, *args, **kw) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 647, in _init self._autoload( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/sql/schema.py", line 670, in _autoload autoload_with.run_callable( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 2212, in run_callable return conn.run_callable(callable_, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/base.py", line 1653, in run_callable return callable_(self, *args, **kwargs) File "/usr/local/lib/python3.8/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 825, in reflecttable rv = super(ClickHouseDialect, self).reflecttable( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 484, in reflecttable return insp.reflecttable( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 664, in reflecttable for col_d in self.get_columns( File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 390, in get_columns col_defs = self.dialect.get_columns( File "<string>", line 2, in get_columns File "/usr/local/lib/python3.8/site-packages/sqlalchemy/engine/reflection.py", line 52, in cache ret = fn(self, con, *args, **kw) File "/usr/local/lib/python3.8/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 863, in get_columns return [self._get_column_info(row.name, row.type) for row in rows] File "/usr/local/lib/python3.8/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 863, in <listcomp> return [self._get_column_info(row.name, row.type) for row in rows] File "/usr/local/lib/python3.8/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 866, in _get_column_info col_type = self._get_column_type(name, format_type) File "/usr/local/lib/python3.8/site-packages/clickhouse_sqlalchemy/drivers/base.py", line 908, in _get_column_type type_enum = enum.Enum('%s_enum' % name, options) File "/usr/local/lib/python3.8/enum.py", line 341, in call return cls._create_( File "/usr/local/lib/python3.8/enum.py", line 465, in _create_ enum_class = metacls.__new__(metacls, class_name, bases, classdict) File "/usr/local/lib/python3.8/enum.py", line 185, in new raise ValueError('Invalid enum member name: {0}'.format( ValueError: Invalid enum member name: 127.0.0.1 - - [05/Oct/2021:19:35:02 +0000] "POST /api/v1/dataset/ HTTP/1.1" 500 26 "http://127.0.0.1:53755/tablemodelview/list/?pageIndex=0&sortColumn=changed_on_delta_humanized&sortOrder=desc" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36" 127.0.0.1 - - [05/Oct/2021:19:35:02 +0000] "GET /static/assets/73f05b21ea1ababa1228.chunk.js HTTP/1.1" 200 1052 "http://127.0.0.1:53755/tablemodelview/list/?pageIndex=0&sortColumn=changed_on_delta_humanized&sortOrder=desc" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.71 Safari/537.36"
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (2 by maintainers)
Top GitHub Comments
triggered by https://github.com/xzkostyan/clickhouse-sqlalchemy/issues/147
If you still have a problem connecting, this document uses a different connector, I tested it last night with Superset 2.0.0 and ClickHouse 22.8:
https://clickhouse.com/docs/en/connect-a-ui/superset-and-clickhouse