SiftScience / sift-python

Sift API (Python client)
MIT License
20 stars 23 forks source link

ApiException in a Celery task results in a PicklingError #74

Closed taylor-smith closed 4 years ago

taylor-smith commented 4 years ago

We are seeing an intermittent MaybeEncodingError when using the Sift Python client inside a Celery task, specifically:

Task handler raised error: <MaybeEncodingError: Error sending result: ''(1, <ExceptionInfo: ApiException("HTTPSConnectionPool(host=\'api.siftscience.com\', port=443): Read timed out. (read timeout=2.0)",)>, None)''. Reason: ''PicklingError("Can\'t pickle <class \'sift.client.ApiException\'>: it\'s not the same object as sift.client.ApiException",)''.>

This seems to occur when Celery uses Pickle to serialize the sift.client.ApiException.

One solution may be to call super inside the __init__ method as described here but I am not sure what downstream effects this would have.

Any thoughts or guidance? Thanks!

taylor-smith commented 4 years ago

Sorry for the notifications, we found a workaround. Closing, thanks