Stephen Herron08/02/2022, 1:28 AM
Seems to work locally but when I try to run ad-hoc via a deployment I get the error:
import asyncio from prefect_snowflake import SnowflakeCredentials from prefect import flow creds = SnowflakeCredentials.load("credentials") from prefect_snowflake.database import snowflake_query @flow(name="Snowflake Query") async def select_something(): result = await snowflake_query( "select 1 as test", creds, ) if __name__ == "__main__": asyncio.run(select_something())
... prefect_snowflake/database.py", line 69, in snowflake_query with snowflake_credentials.get_connection(**connect_params) as connection: AttributeError: 'coroutine' object has no attribute 'get_connection'
alex08/02/2022, 1:33 AM
call and move the call inside your flow. We have some code that makes
sync compatible, but it isn't currently working in deployments.
Stephen Herron08/02/2022, 11:16 AM