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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken RowProxy import with sqlalchemy 1.4 #298

Closed
Kyle-Verhoog opened this issue Mar 15, 2021 · 8 comments 路 Fixed by #299
Closed

Broken RowProxy import with sqlalchemy 1.4 #298

Kyle-Verhoog opened this issue Mar 15, 2021 · 8 comments 路 Fixed by #299

Comments

@Kyle-Verhoog
Copy link

The RowProxy import

from sqlalchemy.engine.result import ResultMetaData, RowProxy
fails because sqlalchemy removed RowProxy in 1.4 馃槙

@Kyle-Verhoog Kyle-Verhoog changed the title Broken import with sqlalchemy 1.4 Broken RowProxy import with sqlalchemy 1.4 Mar 15, 2021
Kyle-Verhoog added a commit to Kyle-Verhoog/dd-trace-py that referenced this issue Mar 15, 2021
- as per encode/databases#298, sqlalchemy 1.4
removed `RowProxy` which causes `databases` to fail
Kyle-Verhoog added a commit to Kyle-Verhoog/dd-trace-py that referenced this issue Mar 15, 2021
- as per encode/databases#298, sqlalchemy 1.4
removed `RowProxy` which causes `databases` to fail
Kyle-Verhoog added a commit to Kyle-Verhoog/dd-trace-py that referenced this issue Mar 15, 2021
- as per encode/databases#298, sqlalchemy 1.4
removed `RowProxy` which causes `databases` to fail
Kyle-Verhoog added a commit to Kyle-Verhoog/dd-trace-py that referenced this issue Mar 15, 2021
- as per encode/databases#298, sqlalchemy 1.4
removed `RowProxy` which causes `databases` to fail
brettlangdon pushed a commit to DataDog/dd-trace-py that referenced this issue Mar 15, 2021
- as per encode/databases#298, sqlalchemy 1.4
removed `RowProxy` which causes `databases` to fail
@rafalp
Copy link
Member

rafalp commented Mar 15, 2021

Oh, so SQLAlchemy 1.4 is out now? That's great!

PR fixing deps welcome <3

@Kyle-Verhoog
Copy link
Author

I'm not very familiar with databases but I'm down to take a shot at fixing it up to learn more! 馃槃

@laozhu
Copy link

laozhu commented Mar 17, 2021

I have the same problem here, I am using pymysql.

File "./services/main.py", line 4, in <module>
    from services.core.database import create_tables
  File "./services/core/database.py", line 16, in <module>
    database_master = Database(_settings.database_master_url)
  File "/Users/Ritchie/Developer/@easynm/cloud/services/.venv/lib/python3.9/site-packages/databases/core.py", line 66, in __init__
    backend_cls = import_from_string(backend_str)
  File "/Users/Ritchie/Developer/@easynm/cloud/services/.venv/lib/python3.9/site-packages/databases/importer.py", line 21, in import_from_string
    raise exc from None
  File "/Users/Ritchie/Developer/@easynm/cloud/services/.venv/lib/python3.9/site-packages/databases/importer.py", line 18, in import_from_string
    module = importlib.import_module(module_str)
  File "/usr/local/Cellar/python@3.9/3.9.1_8/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "/Users/Ritchie/Developer/@easynm/cloud/services/.venv/lib/python3.9/site-packages/databases/backends/mysql.py", line 9, in <module>
    from sqlalchemy.engine.result import ResultMetaData, RowProxy
ImportError: cannot import name 'RowProxy' from 'sqlalchemy.engine.result' (/Users/Ritchie/Developer/@easynm/cloud/services/.venv/lib/python3.9/site-packages/sqlalchemy/engine/result.py)

@noisywiz
Copy link

Hi! One more issue for 1.4 sqlalchemy/sqlalchemy#6096

@rafalp
Copy link
Member

rafalp commented Mar 19, 2021

@rajasimon please pin dependencies to version if you are having problems.

PeterJCLaw added a commit to PeterJCLaw/code-submitter that referenced this issue Mar 19, 2021
@Basit-qc
Copy link

Using databases[mysql]==0.4.2
Had to downgrade sqlalchemy to sqlalchemy==1.3.23

@tomchristie
Copy link
Member

I'd suggest that the sensible first pass for us would be to issue a new release of databases that pins sqlalchemy properly in the setup.py. That'd at least ensure that pip install databases would function properly.

We can then follow up with a PR that adds support for both 1.3 and 1.4, but we'll be under less time pressure to do so, so we're more likely to get it right, and users will have a working databases install in the meantime.

@vijaykumar1356
Copy link

@tomchristie Please do the needful update to have a support for 1.4 SQLAlchemy version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants