cloudflare / sqlalchemy-clickhouse

Apache License 2.0
306 stars 105 forks source link

works wrong for specific clickhouse type LowCardinality(String) #58

Open zhougit86 opened 4 years ago

zhougit86 commented 4 years ago

2020-04-22 13:57:31,804:ERROR:root:No field class for LowCardinality(String) Traceback (most recent call last): File "/root/superset/venv/lib/python2.7/site-packages/superset/sql_lab.py", line 179, in execute_sql **db_engine_spec.cursor_execute_kwargs) File "/root/superset/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py", line 210, in execute self._process_response(response) File "/root/superset/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py", line 341, in _process_response for r in response: File "/root/superset/venv/lib/python2.7/site-packages/infi/clickhouse_orm/database.py", line 244, in select model_class = model_class or ModelBase.create_ad_hoc_model(zip(field_names, field_types)) File "/root/superset/venv/lib/python2.7/site-packages/infi/clickhouse_orm/models.py", line 59, in create_ad_hoc_model attrs[name] = cls.create_ad_hoc_field(db_type) File "/root/superset/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py", line 75, in create_ad_hoc_field inner_field = cls.create_ad_hoc_field(db_type[6 : -1]) File "/root/superset/venv/lib/python2.7/site-packages/sqlalchemy_clickhouse/connector.py", line 91, in create_ad_hoc_field raise NotImplementedError('No field class for %s' % db_type)

zhougit86 commented 4 years ago

@vavrusa

jackpgao commented 4 years ago

用最新版,直接下载master分支,python setup.py install 作者一直没有往pypi更新,pip安装的不是最新的

hyberdk commented 4 years ago

yup it worked for me also, copying in the latest master branch and replace the files in the pip package did the trick.. Thanks jackpgao.

@cloudflare, can you please update the pip package..

vavrusa commented 4 years ago

Sorry, I've been busy. I'll wait a bit for https://github.com/cloudflare/sqlalchemy-clickhouse/pull/47 and update pip package.

Ernestyj commented 4 years ago

seems the #47 is done. Could we update the pip package?

usasha commented 4 years ago

For everyone waiting for pip package: pip install git+https://github.com/cloudflare/sqlalchemy-clickhouse.git will work.

naoko commented 3 years ago

LowCardinality can have FixedString(N) too. Would it be safe to say if db_type contains FixedString then String?

Shardy153 commented 3 years ago

For everyone waiting for pip package: pip install git+https://github.com/cloudflare/sqlalchemy-clickhouse.git will work.

I have put git+https://github.com/cloudflare/sqlalchemy-clickhouse.git in my requirements.txt file but still getting this exception. Can you help me?

badihi commented 2 years ago

The problem still exists for columns of type LowCardinality(Nullable(String)) using the code on master right now.