Hi there, I'm using VSCode to build a data ingest pipeline, but finding debugging in Prefect very difficult. When using the debugger I'm unable to "step into" any functions labeled as a Prefect task, and if I try to print out the results from a Prefect task outside of that function, it just gives me a Prefect object of some kind. Is there any way to debug functions labeled Prefect tasks? I'm using Prefect 1.0 as we're trying to get this up and running asap but will switch to 2.0 soon.
✅ 1
z
Zanie
01/11/2023, 7:20 PM
Hey @Alexander Kloumann — it sounds like you’re trying to debug your flow while defining it in the
with Flow(…)
block
Zanie
01/11/2023, 7:21 PM
At that time, the functions are not executing — instead, you are constructing a DAG and the computation is all deferred until you call
flow.run()
.
a
Alexander Kloumann
01/11/2023, 8:00 PM
Hi Michael, you're right that I'm using the
with Flow(..)
block but I am using
flow.run()
. So how does one debug Prefect tasks?
✅ 1
z
Zanie
01/11/2023, 8:00 PM
No need to send responses to the channel 🙂
Zanie
01/11/2023, 8:00 PM
From what you’ve said, it sounds like your breakpoints are inside the flow declaration block
Zanie
01/11/2023, 8:02 PM
If you have breakpoints in the tasks themselves, you’ll get into a debugger. Execution of the flow itself is managed by an engine — you can’t debug the assignments there as your definition is turned into a DAG which is then executed.
Zanie
01/11/2023, 8:02 PM
If you want that kind of capability, that’s a big part of the design of Prefect 2.
Bring your towel and join one of the fastest growing data communities. Welcome to our second-generation open source orchestration platform, a completely rethought approach to dataflow automation.