hey im trying to use classes with prefect but running into the following... can someone point out the correct way of doing this?
from prefect import Flow, Task, Parameter
class PrintTheStatements(Task):
def task_1():
print(f"first name is {self.firstname} and last name is {self.lastname}")
def run(self, firstname, lastname):
self.firstname = firstname
self.lastname = lastname
task_1()
if __name__ == "__main__":
with Flow("ClassTask") as flow:
firstname = Parameter("firstname", default="anish")
lastname = Parameter("lastname", default="chhaparwal")
apt = PrintTheStatements()
result = apt(firstname=firstname, lastname=lastname)
flow.run()