damien michelle

02/17/2022, 10:50 AM
Hi, I'm new to prefect and I'm facing a TypeError issue when I try to register my prefect workflow to cloud prefect. Does anyone have a solution ? Thanks in advance

Anna Geller

02/17/2022, 11:16 AM
You face an issue with flow serialization. I can see a couple of culprits why this might happen: 1. You should retrieve the logger and log only within your tasks, not within the flow. This is different in Orion, but in 1.0 you can only log within tasks. 2. You have a database connection within your flow - you are committing it within the Flow block. You should move it to a task since DB connections cannot be serialized. In short, you shouldn't do any processing within the Flow block. Flow block should only call your tasks to define a DAG. Again, this is also different in Orion 🙂 in Orion you could do that, but not in Prefect <= 1.0
👍 1

damien michelle

02/17/2022, 2:15 PM
Thanks Anna,
Helps me a lot 🙂
🙌 1