File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -867,6 +867,13 @@ def test_generic_ext_type_equality():
867867 assert not period_type == period_type3
868868
869869
870+ def test_generic_ext_type_pickling ():
871+ # GH-36038
872+ period_type = PeriodType ('D' )
873+ period_type_pickled = pickle .loads (pickle .dumps (period_type ))
874+ assert period_type == period_type_pickled
875+
876+
870877def test_generic_ext_type_register (registered_period_type ):
871878 # test that trying to register other type does not segfault
872879 with pytest .raises (TypeError ):
Original file line number Diff line number Diff line change @@ -1487,6 +1487,9 @@ cdef class ExtensionType(BaseExtensionType):
14871487 """
14881488 return NotImplementedError
14891489
1490+ def __reduce__ (self ):
1491+ return self .__arrow_ext_deserialize__, (self .storage_type, self .__arrow_ext_serialize__())
1492+
14901493 def __arrow_ext_class__ (self ):
14911494 """ Return an extension array class to be used for building or
14921495 deserializing arrays with this extension type.
You can’t perform that action at this time.
0 commit comments