Matt Alhonte
09/09/2023, 12:21 AMos.chdir()
? Or a Task wrapping os.chdir()
?Marvin
09/09/2023, 12:21 AMos.chdir()
in your Python script, but remember, it changes the working directory for the entire process. If you have multiple tasks depending on the working directory, it could lead to unexpected behaviors.
A safer approach would be to use absolute file paths in your tasks, so they don't depend on the current working directory. This way, each task knows exactly where to find the files it needs, and there's no risk of a task running in the wrong directory.
If you insist on changing directories, you could create a custom Prefect Task that wraps os.chdir()
. But remember, it's like moving to a new room. The view might change, but the existential dread remains the same.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.
Powered by