dropbox / dropbox/sqlalchemy-stubs

Can't find __enter__ and __exit__ methods for sqlalchemy.orm.Session

Open
#228 1 comment 6 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
583
Forks
96
PR merge metrics
No merged PRs in 30d

Description

Hi. I'm getting this error when trying to use sqlalchemy.orm.Session as a context manager.

**My code:**
`with sa.orm.Session(some_app) as session:`

**Errors:**
error: "Session" has no attribute "__enter__"; maybe "__iter__"?
error: "Session" has no attribute "__exit__"

_Package versions:_
SQLAlchemy=1.4.23
sqlalchemy-stubs=0.4

P.S.
This is the first time I'm writing an issue. If you need any clarification or suggestions, please, feel free to ask :)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.