tea m i'm stuck in class-based flows, any guidance...
# prefect-getting-started
p
tea m i'm stuck in class-based flows, any guidance will be highly appreciated. class RunSimulation: def __init__(self, data_input, model_input): self.run_simulation(data_input, model_input) @flow(name="run-simulation") def run_simulation(self, data_input, model_input): try: logger = get_run_logger() self.doXtask() @task def doXtask(): done prefect deployment build -sb "s3/data-extractor" -n "data-extractor-deployment" -q "genome" -a "flow.py:RunSimulation"
n
in my experience a better pattern is to have the methods of your class call flows / tasks instead of decorating the actual methods of the class with task or flow
self is going to cause problems, tasks and flows are generally meant to be functional
feel free to share your motivation for a class here