https://prefect.io logo
Title
t

Tim Wisniewski

03/09/2023, 9:31 AM
Hi folks, I'm new to prefect. I've just written my SQLAlchemy models, hoping to query them from a
@task
, but I wrote the models using SQLAlchemy v2, and it looks like Prefect depends on v1.4. Is it not possible to use the latest SQLAlchemy version for my models with Prefect?
r

redsquare

03/09/2023, 9:33 AM
t

Tim Wisniewski

03/09/2023, 9:48 AM
Thanks @redsquare I did see that, but assume dit was about upgrading Prefect's codebase to use SQLAlchemy v2. My question was whether I was limited to v1.4 in my workflow files, which I appreciate may be obvious to someone who's done more work in Python (it's been a while for me!)
r

redsquare

03/09/2023, 9:51 AM
ok sure - not tried it myself as yet
z

Zanie

03/09/2023, 3:41 PM
If you’re running the server elsewhere or using Prefect Cloud you can use a newer version of SQLAlchemy
We only use if it we’re running the server/API — however, it is feasible that we make some calls on import that won’t be supported so I can’t say for sure.
If you do encounter problems, we’d be happy to help fix them.
t

Tim Wisniewski

03/09/2023, 4:30 PM
Thanks Zanie. I haven't gotten to the point of deploying yet, so I don't quite understand how I could "run the server elsewhere" - I'll dig in to the docs on those concepts in a bit. For now, I've translated my model over to sqlalchemy v1.4 - thanks for clarifying though!
z

Zanie

03/09/2023, 5:03 PM
👍 we run the API in-memory whenever you run a flow without setting an API URL
That requires our full stack