Tim Wisniewski

03/09/2023, 4:28 PM
Hey all, I've spent the last two days trying to learn the ropes of Prefect, and I've made a lot of progress, but I have a feeling I may be using prefect-sqlalchemy fundamentally the wrong way. Would someone mind taking a quick glance at my workflow and telling me if I'm on the right track, or way off? (In particular, I have a feeling the way I'm using Sessions is wrong, because the docs for prefect-sqlalchemy don't mention how to use it with ORM, so I took a bit of a leap)


03/09/2023, 5:19 PM
Hi @Tim Wisniewski Using
as a way of retrieving a db engine seems totally valid to me I can't say I know what's happening with your session commit though. As a sanity check, does it do the same thing if you remove the
decorator for

Tim Wisniewski

03/09/2023, 7:34 PM
Thanks Nate that’s great to hear. Appreciate you taking a look. I assumed the issue was because I had two different sessions - one for querying and one for updating (I’m used to rails/active record, where we wouldn’t need to define sessions to read/update models), but I’ll try that.
Yep, that was it—it's because I was using two different sessions. I had to
that object, but I also had to configure my session to
. Starting to wonder if, instead, I should create the session in my
and pass it to each database