https://prefect.io logo
#prefect-community
Title
# prefect-community
a

Alexander Kloumann

01/11/2023, 7:10 PM
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
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 🙂
From what you’ve said, it sounds like your breakpoints are inside the flow declaration block
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.
If you want that kind of capability, that’s a big part of the design of Prefect 2.