# Facing Serialization issues

**URL:** <https://discuss.ray.io/t/facing-serialization-issues/2513>\
**Category:** Ray Core\
**Created:** [June 14, 2021, 2:45pm UTC](https://discuss.ray.io/t/facing-serialization-issues/2513 "2021-06-14T14:45:50Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![SumanthDatta](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sumanthdatta/32/476_2.png) [@SumanthDatta](https://discuss.ray.io/u/SumanthDatta)\
**Post date:** [June 14, 2021, 2:45pm UTC](https://discuss.ray.io/t/facing-serialization-issues/2513/1 "2021-06-14T14:45:50Z")

</div>

Hi ,

when using Parallel Iterator on a Custom Object, which contains pyarrow data. We are facing Serialization Exceptions. PFA for the screenshot.

Ray version : dev -2.0.0  
Python: 3.7.9

When we debug the ray code, inside cloudpickle\_fast.py line no 668 , for the following snippet, it always returns Not implemented.

```
        try:
            is_anyclass = issubclass(t, type)
        except TypeError: # t is not a class (old Boost; see SF #502085)
            is_anyclass = False

        if is_anyclass:
            return _class_reduce(obj)
        elif isinstance(obj, types.FunctionType):
            return self._function_reduce(obj)
        else:
            # fallback to save_global, including the Pickler's
            # dispatch_table
            return NotImplemented

```

Is there any workaround to bypass this issue or a fix can be provided based on evaluation. Any help is appreciated.

 ![Ray-Grpc-issue](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/5/502fca954a1a3c73aad77f2212921177661cba64.png)

---

<div class="post-metadata">

**Author:** ![sangcho](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sangcho/32/425_2.png) [@sangcho](https://discuss.ray.io/u/sangcho)\
**Post date:** [June 16, 2021, 11:35pm UTC](https://discuss.ray.io/t/facing-serialization-issues/2513/2 "2021-06-16T23:35:09Z")

</div>

cc @suquark Have you faced this error? I remember you mentioned some of Pyarrow type has serialization issues. Is there good workaround for this?

---

<div class="post-metadata">

**Author:** ![suquark](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/suquark/32/227_2.png) [@suquark](https://discuss.ray.io/u/suquark)\
**Post date:** [June 17, 2021, 5:42am UTC](https://discuss.ray.io/t/facing-serialization-issues/2513/3 "2021-06-17T05:42:38Z")

</div>

This is the first time I see this error. To me this error indicates the input data contains some Cython objects which are not serializable (Cython objects are not serializable generally because cloudpickle/pickle cannot access the bytecode hidden by Cython). A simple reproducible example would be very helpful. One workaround is to use alternative representations like [https://discuss.ray.io/t/cant-pickle-pyarrow-dataset-expression/1685/8;](https://discuss.ray.io/t/cant-pickle-pyarrow-dataset-expression/1685/8;) another often useful workaround is to avoid defining custom classes in the entrypoint script (if this was the case).

---

<div class="post-metadata">

**Author:** ![SumanthDatta](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/sumanthdatta/32/476_2.png) [@SumanthDatta](https://discuss.ray.io/u/SumanthDatta)\
**Post date:** [June 17, 2021, 5:09pm UTC](https://discuss.ray.io/t/facing-serialization-issues/2513/4 "2021-06-17T17:09:45Z")

</div>

Yes we identified the issue , not passing cython object to ray.

---

<div class="post-metadata">

**Author:** ![selvaganesang](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/selvaganesang/32/1148_2.png) [@selvaganesang](https://discuss.ray.io/u/selvaganesang)\
**Post date:** [June 17, 2021, 5:18pm UTC](https://discuss.ray.io/t/facing-serialization-issues/2513/5 "2021-06-17T17:18:33Z")

</div>

When the error is reported, it would be useful if the error contains the type of the object that caused the serialization issue. Then it will be easier for the caller to identify the issue.
