question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Tests fail with SQLAlchemy 1.4

See original GitHub issue

Tests 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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
raguiar2commented, Nov 10, 2021

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

2reactions
tad3jcommented, Aug 24, 2021

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#L50

Any 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: image

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found