Felipe Saldana
01/28/2021, 9:57 PMUnexpected error: TypeError("Object of type 'TestTask' is not JSON serializable",)
TestTask is a custom task type I created and the run method returns a custom return type I created as well.business_logic_layer = StartFlowRun(flow_name='more_tranformations',
project_name="Felipe First",
wait=True
)(parameters = {"author_info": author_instance})
Does my class need to inherit from a base prefect class?
class CustomRetVal():
def __init__(self, val):
self._val = val
def get_val(self) -> str:
return self._val
def run(self, name, path_to_json, jd) -> CustomRetVal: .......
Fina Silva-Santisteban
01/29/2021, 10:08 PMfrom prefect import Task
class TaskDoSomething(Task):
def run(self, args1, args2):
# Do something
Alternatively, you can just create functions and use the task decorator @task
. I hope this helps!Felipe Saldana
01/29/2021, 10:56 PM