Hi everyone, it is my first time using Prefect and I'm not sure why the following code does not work. Basically I'm trying to set the @flow decorator to a method of a class:
Copy code
from prefect import flow
class myClass:
@flow(log_prints=True)
def start(self):
print("Start class")
if __name__ == "__main__":
myclass = myClass()
myclass.start()
This is the error that I get:
Copy code
Error binding parameters for function 'start': missing a required argument: 'self'.
Thanks for your help!
r
redsquare
03/24/2023, 3:50 PM
flows/tasks are meant to be stateless really so you wont be able to do this
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.