https://prefect.io logo
#best-practices
Title
# best-practices
r

Richard Alexander

09/27/2022, 2:01 PM
I'm using prefect 2.3 and having trouble running a new flow. One of my tasks instantiates a class and returns it, then fails with the following error:
Copy code
cannot pickle '_thread.lock' object
I have found some methods to get around this for v1, but I can't find anything for v2. How can I get this flow to run?
z

Zanie

09/27/2022, 2:20 PM
We’re working on allowing persistence of results to be disabled
In the meantime, you’d have to ensure your class is serializable. It looks like it’s got a threading.Lock attached to it?
r

Richard Alexander

09/27/2022, 2:22 PM
I'm running some Selenium Firefox scripts, so webdriver must have a thread lock, yes.
@Zanie Will it work if I don't return the results from a task... just use a normal method instead as a workaround?
z

Zanie

09/27/2022, 3:01 PM
Yeah definitely
r

Richard Alexander

09/27/2022, 3:08 PM
That did work. Thanks for the help Michael! 😄
7 Views