https://dagster.io/ logo
#ask-community
Title
# ask-community
j

Jordan W

07/12/2021, 11:02 PM
Hello, got a quick question. Are there any testing examples (preferably with invocation) of
async
solids? currently working through this and there is a
DagsterTypeCheckDidNotPass
with type failure along the lines of
expected return_type got coroutine
. Our tests that use
execute_solid
for our async solids still work fwiw
basic example
Copy code
@solid
async def foo_async() -> str:
    return "bar"



@pytest.mark.asyncio
async def test_foo():
    result = await foo_async()
    assert result == "bar"
a

alex

07/13/2021, 4:23 PM
@chris
j

Jordan W

07/13/2021, 4:33 PM
Forgot to mention yesterday, but the test passed without the type annotation. Once adding it, it throws the type error
c

chris

07/13/2021, 4:35 PM
taking a look
a

alex

07/13/2021, 4:36 PM
ah type annotation - that seems like what we need to repro the bug. Thanks for the report! edit: clarity
j

Jordan W

07/13/2021, 4:36 PM
yep, sees type
coroutine
but expects
str
sorry if that wasnt clear
c

chris

07/13/2021, 4:47 PM
I don't think type annotation is the bug - I think we're getting the coroutine and not unfurling it properly
2 Views