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

Unhashable type error when adding a table #8915

Closed
kinghuang opened this issue Jan 2, 2020 · 2 comments
Closed

Unhashable type error when adding a table #8915

kinghuang opened this issue Jan 2, 2020 · 2 comments
Labels

Comments

@kinghuang
Copy link

@kinghuang kinghuang commented Jan 2, 2020

I've added a Redshift database, and I'm trying to add a table. After I select the database and fill in the schema and table name, I get a TypeError: unhashable type: 'list' from Superset.

Expected results

The table should be added.

Actual results

A TypeError is raised.

Screenshots

2020-01-02 19:31:30,418:INFO:root:Database.get_sqla_engine(). Masked URL: redshift+psycopg2://XXXXXXXXXX:XXXXXXXXXX@XXXXXXXXXX:5439/XXXXXXXXXX
Got an error in pre_add for sa.invoice_detail
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/views.py", line 351, in pre_add
    table.get_sqla_table_object()
  File "/usr/local/lib/python3.6/site-packages/superset/connectors/sqla/models.py", line 964, 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 1161, 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 128, in warned
    return fn(*args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 506, in __new__
    metadata._remove_table(name, schema)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/langhelpers.py", line 68, in __exit__
    compat.reraise(exc_type, exc_value, exc_tb)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/util/compat.py", line 153, in reraise
    raise value
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 501, in __new__
    table._init(name, metadata, *args, **kw)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 595, in _init
    resolve_fks=resolve_fks,
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/sql/schema.py", line 619, in _autoload
    _extend_on=_extend_on,
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 2163, in run_callable
    return conn.run_callable(callable_, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/base.py", line 1615, in run_callable
    return callable_(self, *args, **kwargs)
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/default.py", line 460, in reflecttable
    table, include_columns, exclude_columns, resolve_fks, **opts
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 642, in reflecttable
    table_name, schema, **table.dialect_kwargs
  File "/usr/local/lib/python3.6/site-packages/sqlalchemy/engine/reflection.py", line 369, 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 50, in cache
    ret = info_cache.get(key)
TypeError: unhashable type: 'list'

How to reproduce the bug

  1. Go to Sources → Tables.
  2. Click on + (Add a new record).
  3. Fill in the database, schema, and table name. Press Save.
  4. See error.

Environment

(please complete the following information):

  • superset version: Superset 0.35.1
  • python version: Python 3.6.10
  • node.js version: none
  • npm version: none

Checklist

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 there are 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.

Additional context

None.

@issue-label-bot

This comment has been minimized.

Copy link

@issue-label-bot issue-label-bot bot commented Jan 2, 2020

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.94. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@issue-label-bot issue-label-bot bot added the #bug label Jan 2, 2020
@kinghuang

This comment has been minimized.

Copy link
Author

@kinghuang kinghuang commented Jan 2, 2020

It appears this issue was introduced by a change in sqlalchemy 1.3.11 that impacts sqlalchemy-redshift. I'm able to work around it by temporarily downgrading to sqlalchemy 1.3.10.

sqlalchemy/sqlalchemy#4984

@kinghuang kinghuang closed this Jan 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.