Investigate errors in SQLAlchemy 1.3
See original GitHub issueAfter bringing in #6, we’ve had reports of unreliability with some tests:
@charness thank you for the fix, I couldn’t trace this down for a long time!
However, it introduced some flakiness in our test suite for several tests that do a commit and then check if the attribute changes. Have you had anything like it?
The code is similar to this:
def test_should_confirm_account(db_session, app_client):
user = UserFactory()
token = user.generate_token_and_save_timestamp()
db_session.add(user)
# First commit or flush in some cases
db_session.commit()
# One more commit here:
response = app_client.post("/account/confirm", json={"token": token})
assert response.status_code == 200
# Fails with:
# Instance <User at 0x108bf1d30> is not bound to a Session; attribute refresh operation cannot proceed (Background on this error at: http://sqlalche.me/e/bhk3
assert user.is_confirmed()
Check to see if this example can be reproduced, and if so, investigate the root cause of the problem.
Edit 3/12: This appears to be a problem with SQLAlchemy 1.3. Pinning your SQLAlchemy version to <1.3
should fix any errors in the meantime while we figure out what exactly is going on.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (4 by maintainers)
Top Results From Across the Web
Error Messages - SQLAlchemy 1.4 Documentation
Exception raised for programming errors, e.g. table not found or already exists, syntax error in the SQL statement, wrong number of parameters specified,...
Read more >ORM Exceptions — SQLAlchemy 1.3 Documentation
A SELECT is emitted for the target row based on primary key; if no row is returned, this exception is raised.
Read more >SQLAlchemy 1.3 Documentation
A high level view and getting set up. Overview | Installation Guide | Frequently Asked Questions | Migration from 1.2 | Glossary |...
Read more >SQLAlchemy error: An attempt to complete a transaction has ...
SQLAlchemy (1.3.5); Pandas (0.24.2). and I want to create just a proof of concept using SQLAlchemy with an Azure SQL Data Warehouse.
Read more >Connection Pooling - SQLAlchemy 1.1 Documentation
SQLAlchemy includes several connection pool implementations which ... system called is_disconnect() which will examine the contents of an exception object, ...
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
Just published v1.0.2 providing support for SQLAlchemy 1.3. Thanks for the help figuring this out, all!
@jeancochrane you’re amazing!