Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.26.0 unable to query/connect to clickhouse #5345

Closed
3 tasks done
zyclonite opened this issue Jul 4, 2018 · 5 comments
Closed
3 tasks done

0.26.0 unable to query/connect to clickhouse #5345

zyclonite opened this issue Jul 4, 2018 · 5 comments
Labels
#bug:cant-reproduce Bugs that cannot be reproduced

Comments

@zyclonite
Copy link

Make sure these boxes are checked before submitting your issue - thank you!

  • I have checked the superset logs for python stacktraces and included it here as text if any
  • I have reproduced the issue with at least the latest released version of superset
  • I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.26.0 with all pip dependencies from the requirements.txt

additional libs

sqlalchemy-clickhouse==0.1.3.post0

Expected results

same charts and query results like before the update from 0.25.6 (same sqlalchemy-clickhouse version)

Actual results

no chart, no dashboard, nor any single query in the lab works

2018-07-04 16:11:33,668:ERROR:root:'str' object has no attribute 'db_type'
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 743, in query
    df = self.database.get_df(sql, self.schema)
  File "/usr/local/lib/python3.6/site-packages/superset/models/core.py", line 700, in get_df
    df = pd.read_sql_query(sqls[-1], eng)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 332, in read_sql_query
    parse_dates=parse_dates, chunksize=chunksize)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 1092, in read_query
    result = self.execute(*args)
  File "/usr/local/lib/python3.6/site-packages/pandas/io/sql.py", line 983, in execute
    return self.connectable.execute(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2075, in execute
    return connection.execute(statement, *multiparams, **params)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 942, in execute
    return self._execute_text(object, multiparams, params)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1104, in _execute_text
    statement, parameters
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1200, in _execute_context
    context)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1416, in _handle_dbapi_exception
    util.reraise(*exc_info)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 187, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1193, in _execute_context
    context)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 507, in do_execute
    cursor.execute(statement, parameters)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy_clickhouse/connector.py", line 209, in execute
    self._process_response(response)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy_clickhouse/connector.py", line 342, in _process_response
    cols = [(f[0], f[1].db_type) for f in r._fields]
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy_clickhouse/connector.py", line 342, in <listcomp>
    cols = [(f[0], f[1].db_type) for f in r._fields]
AttributeError: 'str' object has no attribute 'db_type'

Steps to reproduce

docker run --name superset -p 8088:8088 noenv/superset:0.26.0
and try to connect to a clickhouse instance

@mistercrunch
Copy link
Member

On our side it's a simple pandas.read_sql_query and it's sqlalchemy_clickhouse raising the issue, this seems external to Superset. Maybe 0.26.0 requires a newer Pandas that doesn't play well with the clickhouse dialect?

@zyclonite
Copy link
Author

pandas, sqlalchemy and the clickhouse lib are the same versions between 0.25.6 and 0.26.0

@mistercrunch mistercrunch added help wanted #bug:cant-reproduce Bugs that cannot be reproduced labels Jul 5, 2018
@zyclonite
Copy link
Author

tested 0.26.3 now

  • same issue on existing installation
  • even after a clean install, adding a database fails already

@zyclonite
Copy link
Author

the issue comes from the upgrade of infi.clickhouse-orm from 0.9.8 to 1.0.0
this lib is a dependency of sqlalchemy_clickhouse

so not a superset issue

@Manikandan25
Copy link

When connecting the superset with clickhouse, I faced the same issue that "Error:'str' object has no attribute 'db_type'.
After reading this conversation, I downgraded my infi.clickhouse-orm package using the following command:
sudo pip install infi.clickhouse-orm==0.9.8

then, I restarted my superset server and now, Its working fine.
Thank you,
Manikandan.K

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
#bug:cant-reproduce Bugs that cannot be reproduced
Projects
None yet
Development

No branches or pull requests

3 participants