aman gupta
08/02/2021, 12:07 PMKevin Kho
Client
or some like of database connection?aman gupta
08/02/2021, 6:20 PMKevin Kho
cloudpickle
to be handed to Dask. I would check if you can serialize the MyTask
class. It might be your logger also if it’s sending logs to cloud? Can you try from prefect.utilities.debug import is_serializable
and then is_serializable(MyTask)
or is_serializable(flow)
aman gupta
08/02/2021, 6:50 PMKevin Kho
import cloudpickle
and then cloudpickle.dumps(MyTask())
. Or you can try returning something other than self
first. What is this task doing? Just logging the params?aman gupta
08/02/2021, 7:09 PMresult_dict = {'val1': self.property1, 'value2': self.property2, 'value3': self.property3}
return result_dict
--> The task is just mapping the prams from a dictionary from a previous task and making a object of it and returning that object and also doing logging in between on cloud.Kevin Kho
run
method of the task and then use it but not return it with the self
aman gupta
08/02/2021, 8:31 PMKevin Kho
Kevin Kho
Kevin Kho
logger.addHandler(GCPHandler)
to write to Google cloud. I suggest instead that you
1. Return the serializable stuff instead of self. Self returns a Task and you want to be dealing with the outputs, not returning the Task upon running.
2. Use the Prefect logger, and then you can add the handler to it inside the task