Hi - Is it possible to have a class with x number ...
# ask-community
i
Hi - Is it possible to have a class with x number of methods as tasks?
c
Hi itay - I don’t think I understand the question; if you create a Task class by subclassing the Prefect task you can definitely add as many methods to it as you want that you can call within your run method
i
something like this
Basically a class with multiple run methods
c
Gotcha; unfortunately I don’t think this will work. What you could do instead might be:
Copy code
class BaseDefinitions(Task):
    ...
and then subclass this into two distinct Task classes with different run methods -> that way you can still reuse your other methods / logic
i
yeah - that is the conclusion I got to after mucking around a bit more