You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please do not use Flask-SQLAlchemy or any other third-party extensions or dependencies in test cases. The test case must illustrate the problem without using any third party SQLAlchemy extensions. Otherwise, please report the bug to those projects first.
PS C:\Users\Lucina\PycharmProjects\PTF> mypy test1.py
test1.py: note: In function "test":
test1.py:8:17: note: Revealed type is 'sqlalchemy.ext.asyncio.engine.AsyncEngine._trans_ctx'
test1.py:10:15: error: "_trans_ctx" has no attribute "execute" [attr-defined]
await connection.execute(...)
^
Found 1 error in 1 file (checked 1 source file)
Versions.
OS: Windows 10
Python: 3.9.4
SQLAlchemy: 1.4.14
mypy: 0.812
SQLAlchemy2-stubs: 0.0.2a1
Additional context
This feels similar to #93 except that issue seems to focus on the return type of AsyncEngine.begin() without actually raising the fact that the typed behaviour of AsyncEngine._trans_ctx is erroneous.
Have a nice day!
The text was updated successfully, but these errors were encountered:
* Fix return typing of AsyncEngine._trans_ctx.__aenter__
* StartableContext is made generic as to remove the assumption that it'll always be returning itself which is not the case for for it's behaviour in _trans_ctx
* tests: add testcase for #109
Co-authored-by: Faster Speeding <luke@lmbyrne.dev>
Describe the bug
AsyncEngine._trans_ctx
is typed as returning itself on__aenter__
.Expected behavior
AsyncEngine._trans_ctx
should be typed as returning AsyncConnection on__aenter__
.To Reproduce
Please try to provide a Minimal, Complete, and Verifiable example.
See also Reporting Bugs on the website, and some example issues.
Please do not use Flask-SQLAlchemy or any other third-party extensions or dependencies in test cases. The test case must illustrate the problem without using any third party SQLAlchemy extensions. Otherwise, please report the bug to those projects first.
Error
Versions.
Additional context
This feels similar to #93 except that issue seems to focus on the return type of AsyncEngine.begin() without actually raising the fact that the typed behaviour of AsyncEngine._trans_ctx is erroneous.
Have a nice day!
The text was updated successfully, but these errors were encountered: