Tests fail with SQLAlchemy 1.4
See original GitHub issueTests fail with SQLAlchemy 1.4:
ERROR collecting graphene_sqlalchemy/tests/test_converter.py
ImportError while importing test module 'graphene-sqlalchemy/graphene_sqlalchemy/tests/test_converter.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
graphene_sqlalchemy/tests/test_converter.py:9: in <module>
from sqlalchemy_utils import ChoiceType, JSONType, ScalarListType
.tox/py39/lib/python3.9/site-packages/sqlalchemy_utils/__init__.py:1: in <module>
from .aggregates import aggregated # noqa
.tox/py39/lib/python3.9/site-packages/sqlalchemy_utils/aggregates.py:372: in <module>
from .functions.orm import get_column_key
.tox/py39/lib/python3.9/site-packages/sqlalchemy_utils/functions/__init__.py:1: in <module>
from .database import ( # noqa
.tox/py39/lib/python3.9/site-packages/sqlalchemy_utils/functions/database.py:10: in <module>
from ..expressions import explain_analyze
.tox/py39/lib/python3.9/site-packages/sqlalchemy_utils/expressions.py:4: in <module>
from sqlalchemy.sql.expression import (
E ImportError: cannot import name '_literal_as_text' from 'sqlalchemy.sql.expression' (graphene-sqlalchemy/.tox/py39/lib/python3.9/site-packages/sqlalchemy/sql/expression.py)
https://github.com/sqlalchemy/sqlalchemy/commit/f07e050c9ce4afdeb9c0c136dbcc547f7e5ac7b8
The library itself seems to work fine with batching disabled.
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Intermittent unit test failures in sqlAlchemy due to database not ...
I have a collection of unit tests that run in a gitlab pipeline. The following code is meant to rebuild the database between...
Read more >Error Messages - SQLAlchemy 1.4 Documentation
Exception raised when the database encounters an internal error, e.g. the cursor is not valid anymore, the transaction is out of sync, etc....
Read more >Developers - Tests fail with SQLAlchemy 1.4 - - Bountysource
Tests fail with SQLAlchemy 1.4 : ERROR collecting graphene_sqlalchemy/tests/test_converter.py ImportError while importing test module ...
Read more >Make unit tests compatible with SQLAlchemy 1.4 - OpenDev
Make unit tests compatible with SQLAlchemy 1.4. Browse Source. The .count() method is gone from the Table class. Let's use func.count in its...
Read more >1959305 – python-sqlalchemy fails to build with Python 3.10
test_await_only_error. [gw0] linux -- Python 3.10.0 /usr/bin/python3 Traceback (most recent call last): File "/builddir/build/BUILD/SQLAlchemy-1.4.14/test/../ ...
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 FreeTop 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
Top GitHub Comments
Is a release going to be cut with this feature? It would be useful to have the most up-to-date version of graphene-sqlalchemy on pypi so it can be used with 1.4
I’ve noticed the same with batching. I think the reason is that they changed
QueryContext
in SQLAlchemy v1.4:v1.3 usage (used by this lib): https://github.com/graphql-python/graphene-sqlalchemy/blob/20ecaeadf2144b88555a3daf1a04e31b7f2ff95a/graphene_sqlalchemy/batching.py#L55
In v1.4
QueryContext
expects multiple arguments while v1.3 only had a single one: https://github.com/sqlalchemy/sqlalchemy/blob/cb8906bab1776bafed48ef69ded0768461f7e7b8/lib/sqlalchemy/orm/context.py#L50Any plans to update batching to work with 1.4? Without that we should lock our SQLALchemy versions to v1.3 if we want to use batching.
If support is added, should it support both v1.3 and v1.4
QueryContext
?EDIT: This is the exception I get when querying: