records python3 is not compatible with new sqlalchemy release 1.4.0
See original GitHub issueI am getting the following error when trying to parse the results of a query. Digging into this more, this seems to be an issue with compatibility with the new sqlalchemy that was released this week (March 14, 2021).
There doesn’t appear to be any version restrictions defined in the setup.py which allows things like pip to grab the newer 1.4.0 release which is not usable.
The easiest fix would be to update the setup.py to ensure sqlalchemy < 1.4 is used.
Example code:
db_reader = records.Database(DB_URL)
rows = db_reader.query(SQL, fetchall=True, **kwargs)
row_dict = {key: check_type(value) for (key, value) in dict(rows[0]).items()}
Example error:
AttributeError: 'RMKeyView' object has no attribute 'index'
This is thrown from the following line. https://github.com/kenreitz42/records/blob/c23f5770127826665402e17ab4e115127b5489c5/records.py#L54
Seems like the sqlalchemy 1.4.0 changes some interfaces. When I reverted to sqlalchemy 1.3.23, it appears to work again.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:8
- Comments:6
Top Results From Across the Web
records python3 is not compatible with new sqlalchemy ...
I am getting the following error when trying to parse the results of a query. Digging into this more, this seems to be...
Read more >Records is not compatible with Python 3.8+ #214 - GitHub
records python3 is not compatible with new sqlalchemy release 1.4.0 (#208) #208 but versions of sqlalchemy older than 1.4.0 are not ...
Read more >What's New in SQLAlchemy 1.4?
Python 2.7 is still supported, however the SQLAlchemy 1.4 series will be the last series to support Python 2.
Read more >SQLAlchemy: create_engine() error on deprecations.py
My SQLAlchemy version on my local with GCP has the same version. Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages ...
Read more >pandas.DataFrame.to_sql — pandas 1.5.2 documentation
Write records stored in a DataFrame to a SQL database. Databases supported by SQLAlchemy [1] are supported. ... sqlite3 or SQLAlchemy. New in...
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
I have the same problem. Im using
flask-sqlalchemy==2.4.3
inrequirements.txt
. I didn’t pinned the version ofsqlalchemy
. AndFlask-sqlalchemy
pinned thesqlalchemy
with>=1.2
in prod(at20210208
published):in prod(at
20210324
published):Temporary solutions is pinned
sqlalchemy
:Perhaps this is a regression on the part of sqlalchemy, they released a patched 1.4.1 today that fixed many regressions but this still seems to be an issue even when using 1.4.1