Thread
#prefect-community
    y

    Yusuf Khan

    8 months ago
    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
    ?
    Kevin Kho

    Kevin Kho

    8 months ago
    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

    8 months ago
    Okay fair enough that makes sense! thank you