Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AsyncEngine.begin() returns _trans_ctx instead of expected AsyncTransaction #93

Closed
blazewicz opened this issue May 5, 2021 · 2 comments
Labels
question Further information is requested wontfix This will not be worked on

Comments

@blazewicz
Copy link

AsyncConnection.begin() returns AsyncTransaction, like one would expect:

def begin(self) -> AsyncTransaction: ...

however, AsyncEngine.begin() returns _trans_ctx:

def begin(self) -> _trans_ctx: ...

This leads to following errors, when user declares argument type to AsyncTransaction.

error: Argument "bar" to "foo" has incompatible type "_trans_ctx"; expected "AsyncTransaction"
@CaselIT
Copy link
Member

CaselIT commented May 6, 2021

Hi,

The typing itself is actually correct, see https://github.com/sqlalchemy/sqlalchemy/blob/master/lib/sqlalchemy/ext/asyncio/engine.py

But I'm not entirely sure if we could make the two begin behave more similarly wrt returned object. @zzzeek can't we return an async transaction from the engine.begin?

@CaselIT
Copy link
Member

CaselIT commented Jul 30, 2021

I think this is a won't fix for now

@CaselIT CaselIT closed this as completed Jul 30, 2021
@CaselIT CaselIT added the wontfix This will not be worked on label Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants