sqlalchemy redshift TypeError: unhashable type: 'list' version 1.3.11
See original GitHub issueAfter upgrading to 1.3.11, I am getting the following error when trying to reflect a AWS Redshift table: TypeError: unhashable type: 'list'
. I am using the sqlalchemy-redshift dialect.
from sqlalchemy import create_engine, Table, MetaData
connect_args = dict(sslmode="verify-ca", keepalives_idle=200)
uri = 'redshift+psycopg2://<user>:<pass>@redshift-cluster:5439/my-db'
engine = create_engine(uri, connect_args=connect_args)
meta = MetaData()
t = Table('my_table', meta, schema='my_schema', autoload=True, autoload_with=engine)
If I downgrade to 1.3.10 then it works fine. The only data types in the table I am trying to reflect are bigint, timestamp, date, and varchar.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
sqlalchemy-redshift - PyPI
Fix unhashable type error for sortkey reflection in SQLAlchemy >= 1.3.11 (Issue #180). Expose supported types for import from the dialect (Issue #181)....
Read more >unhashable type: 'list' when using sqlalchemy and pandas df ...
I'm trying to read using sqlalchemy and then insert into Oracle DB. pd.read_sql_query works fine and when I execute display (df), ...
Read more >sqlalchemy-redshift Changelog - pyup.io
PyUp actively tracks 467,103 Python packages for vulnerabilities to keep your ... Fix unhashable type error for sortkey reflection in SQLAlchemy >= 1.3.11...
Read more >Cannot retrieve PostgreSQL array column with session.query()
TypeError : unhashable type: 'list' Full code : import os from sqlalchemy import create_engine, Table, Integer, MetaData, Column from sqlalchemy.orm import ...
Read more >httpry-0.1.8-1.el6 - Pulp Repository Index
Changes since version '3.4.7′ are: * Fix database corruption- TypeError: unhashable type: 'list' * Fix bug in abandon changes and quit * Fix...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
they (sqlalchemy-redshift) are hitting a hard change I had to make to fix #4955. so what is happening is that they have options like “sortkey” which they are reflecting at https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/blob/master/sqlalchemy_redshift/dialect.py#L583 . these options get passed back into methods like get_coulmns(), for them it is at https://github.com/sqlalchemy-redshift/sqlalchemy-redshift/blob/master/sqlalchemy_redshift/dialect.py#L418, and the
@reflection.cache
they are using, which is optional, now caches on all the keyword arguments, including the list-based “sortkey” and others we see coming from table arguments.so redshift has to either a. ensure table kwargs like sortkey and others are hashable, usually by making them into tuples or b. don’t use
@reflection.cache
.they also should look into having a CI build that tests against the latest SQLAlchemy version.
hi @zzzeek i have similar issue with mysql where it returns
unhashable type: 'bytearray'
when i try to reflect a table. any ideas how to solve that?