You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When debugging flows in Prefect on Windows, it is impossible to set breakpoints inside flows. The debugger does not connect to the subprocesses spawned by the flow execution. This behavior occurs with both VSCode and PyCharm, making it difficult to debug flow-related code.
Steps to Reproduce
A minimal reproducible example:
fromprefectimportflow@flowdefmy_flow():
print("Starting flow execution...") # put your pycharm/vscode breakpoint here, but it will never hit it on windows pycharm/vscodereturn"Done!"if__name__=="__main__":
my_flow()
Run the code with a debugger attached (VSCode or PyCharm).
Attempt to hit the breakpoint() inside the flow.
Expected behavior
The debugger should connect to the subprocess, allowing breakpoints to be hit for debugging.
Actual behavior
The debugger does not connect to the flow subprocess, and breakpoints are skipped. Debugging inside flows is impossible.
Version info
Version: 3.0.10
API version: 0.8.4
Python version: 3.11.7
Git commit: 3aa2d893
Built: Tue, Oct 15, 2024 1:31 PM
OS/Arch: win32/AMD64
Profile: local
Server type: server
Pydantic version: 2.9.2
Additional context
This issue seems to be related to how Prefect spawns subprocesses on Windows, as debugging works fine for regular Python scripts. Debugging flows in Prefect on other operating systems (e.g., Linux) does not encounter the same issue.
This limitation severely impacts the development workflow for Windows users, especially for debugging complex flows.
Thank you for investigating this issue!
The text was updated successfully, but these errors were encountered:
Bug summary
When debugging flows in Prefect on Windows, it is impossible to set breakpoints inside flows. The debugger does not connect to the subprocesses spawned by the flow execution. This behavior occurs with both VSCode and PyCharm, making it difficult to debug flow-related code.
Steps to Reproduce
A minimal reproducible example:
breakpoint()
inside the flow.Expected behavior
The debugger should connect to the subprocess, allowing breakpoints to be hit for debugging.
Actual behavior
The debugger does not connect to the flow subprocess, and breakpoints are skipped. Debugging inside flows is impossible.
Version info
Additional context
This issue seems to be related to how Prefect spawns subprocesses on Windows, as debugging works fine for regular Python scripts. Debugging flows in Prefect on other operating systems (e.g., Linux) does not encounter the same issue.
This limitation severely impacts the development workflow for Windows users, especially for debugging complex flows.
Thank you for investigating this issue!
The text was updated successfully, but these errors were encountered: