Abhas P
09/01/2021, 4:56 PMUnexpected error: TypeError("cannot pickle '_thread.lock' object")
The task blueprint looks like this :
def mongo_connect():
db = get_db() // wrapper on top of pymongoclient to connect to the specified db
collection = get_collection(db). // wrapper on top of pymongoclient to get a specified collection form the db
return collection
I understand that prefect needs to pickle all the tasks , but this code works fine while being run as an independent script (without prefect decorators).
How can I make the connection threadlock safe or rather pickle safe?Kevin Kho
Abhas P
09/01/2021, 5:02 PMKevin Kho
Abhas P
09/01/2021, 5:33 PMKevin Kho
Kevin Kho
Abhas P
09/01/2021, 7:34 PMKevin Kho