Uploaded image for project: 'Apache Arrow'
  1. Apache Arrow
  2. ARROW-1450

[Python] Raise proper error if custom serialization handler fails

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.7.0
    • Component/s: Python
    • Labels:
      None

      Description

      At the moment, the following fails:

      def test_serializaton_callback_error():
      
          class TempClass(object):
                  pass
      
          # Have a SerializationContext but TempClass is not
          # registered
      
          serialization_context = pa.SerializationContext()
      
          with pytest.raises(pa.SerializationCallbackError):
              serialized_object = pa.serialize(TempClass, serialization_context)
      

      This is because serialize will raise a generic ArrowException instead of a SerializationCallbackError. We do need the latter because it contains the object that couldn't be serialized, which is important to give good error messages; in the case of Ray we sometimes want use the object to register additional serialization callbacks on the fly to make the user experience smoother.

        Attachments

          Activity

            People

            • Assignee:
              pcmoritz Philipp Moritz
              Reporter:
              pcmoritz Philipp Moritz
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: