Github user Stibbons commented on a diff in the pull request:
https://github.com/apache/spark/pull/15026#discussion_r78464418
--- Diff: python/pyspark/broadcast.py ---
@@ -75,7 +75,13 @@ def __init__(self, sc=None, value=None,
pickle_registry=None, path=None):
self._path = path
def dump(self, value, f):
- pickle.dump(value, f, 2)
+ try:
+ pickle.dump(value, f, 2)
+ except pickle.PickleError:
+ raise
+ except Exception as e:
+ msg = "Could not serialize broadcast: " + e.__class__.__name__
+ ": " + e.message
+ raise pickle.PicklingError(msg)
--- End diff --
it is indeed a good practice to log when wrapping exception is more
contextual one. logging.exception(msg) will be perfect
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]