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

[Python] Raise proper error if custom serialization handler fails

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 0.7.0
    • Python
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: