-
Notifications
You must be signed in to change notification settings - Fork 6.8k
[core] Improve docs for custom serialization for exceptions + add test #56156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[core] Improve docs for custom serialization for exceptions + add test #56156
Conversation
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: Sampan S Nayak <sampansnayak2@gmail.com>
Signed-off-by: sampan <sampan@anyscale.com>
…nserializable-exception2 Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: Sampan S Nayak <sampansnayak2@gmail.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
Signed-off-by: sampan <sampan@anyscale.com>
…unserializable-exception2 Signed-off-by: sampan <sampan@anyscale.com>
@@ -330,6 +330,42 @@ def f(): | |||
assert clean_noqa(expected_output) == scrub_traceback(str(excinfo.value)) | |||
|
|||
|
|||
def test_exception_with_registered_serializer(shutdown_only): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file can probably be converted to using ray_start_regular_shared
-- can you try? (separate PR if you prefer)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ill raise a separate pr for this
Signed-off-by: sampan <sampan@anyscale.com>
@@ -202,6 +202,61 @@ There are at least 3 ways to define your custom serialization process: | |||
except TypeError: | |||
pass | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Create a link here by doing
.. _custom-exception-serializer
so that later on you can refer in the docstring.
python/ray/exceptions.py
Outdated
@@ -916,7 +916,8 @@ class UnserializableException(RayError): | |||
the original exception along with its stack trace that was captured at the | |||
time of serialization. | |||
|
|||
reference for more details: https://docs.ray.io/en/latest/ray-core/objects/serialization.html | |||
For more details and how to handle this with custom serializers, see: | |||
https://docs.ray.io/en/latest/ray-core/objects/serialization.html#custom-serializers-for-exceptions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://docs.ray.io/en/latest/ray-core/objects/serialization.html#custom-serializers-for-exceptions | |
:ref:`xxx <custom-exception-serializer>` |
Signed-off-by: sampan <sampan@anyscale.com>
@jjyao addressed comments |
ray-project#56156) Signed-off-by: sampan <sampan@anyscale.com> Signed-off-by: Sampan S Nayak <sampansnayak2@gmail.com> Co-authored-by: sampan <sampan@anyscale.com>
builds on top of #55878
Because we are using cloud pickle to deserailize the exception, custom serializers registered using
register_serializer
already work out of the box. This PR adds a test case to cover this usecase, adds a new section to the docs describing what users can do when they run into the issue and updates theUnserializableException
error message to point to the section in the docsRelated issue number
NA
Checks
git commit -s
) in this PR.scripts/format.sh
to lint the changes in this PR.method in Tune, I've added it in
doc/source/tune/api/
under thecorresponding
.rst
file.