Giang Hoang Le12/10/2019, 11:03 PM
class and subclass it with normal Python inheritance.
decorator and most examples that call tasks like functions show a “functional API” but the “imperative API” embraces the full class-based set up (https://docs.prefect.io/core/getting_started/first-steps.html#imperative-api).
Giang Hoang Le12/10/2019, 11:08 PM
then I’m sure it would work. If they are
@staticmethod and @task
or “normal” methods then the first argument might create an issue
Giang Hoang Le12/10/2019, 11:36 PM
objects, call them, and return them, something like:
class Source: def transform(self, x): # some logic that depends on Source task = MyTransformTaskClass() return task(x)
Giang Hoang Le12/10/2019, 11:40 PM
itself is a full class so it will be difficult for it to exist exclusively as a method of another class. However,
is one way to get there (but, because its a staticmethod, you won’t be able to access the parent
to parameterize your “factory methods” that generate and return tasks dynamically depending on how
Giang Hoang Le12/11/2019, 12:34 AM