https://prefect.io logo
y

Yusuf Khan

01/07/2022, 5:25 PM
Hey guys, just a general best practice question, I'm still very early in my learning journey with Prefect. What I'm seeing in the documentation is largely tasks as functions. And in the case of passing data between tasks, that's usually done by assigning a variable the value of the output of a task, and then passing that variable as an argument to another task. What's the guidance on doing this in an object-oriented way? Can tasks be methods? and then the methods can simply access values through
self
?
k

Kevin Kho

01/07/2022, 5:42 PM
I think you run into problems when you do it that way because
@task
returns a class, not a function. So you end up with nested classes
y

Yusuf Khan

01/07/2022, 6:12 PM
Okay fair enough that makes sense! thank you
6 Views