You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2022/10/11 12:17:54 UTC

[GitHub] [arrow] jorisvandenbossche commented on a diff in pull request #14238: ARROW-17813: [Python] Nested ExtensionArray conversion to/from pandas/numpy

jorisvandenbossche commented on code in PR #14238:
URL: https://github.com/apache/arrow/pull/14238#discussion_r992250647


##########
python/pyarrow/tests/test_extension_type.py:
##########
@@ -60,6 +60,22 @@ def __reduce__(self):
         return UuidType, ()
 
 
+class LabelType(pa.ExtensionType):
+
+    def __init__(self):
+        super(LabelType, self).__init__(pa.string(), "label")
+
+    def __reduce__(self):
+        return LabelType, ()
+
+    def __arrow_ext_serialize__(self):
+        return b""
+
+    @classmethod
+    def __arrow_ext_deserialize__(cls, storage_type, serialized):
+        return LabelType()

Review Comment:
   ```suggestion
   class LabelType(pa.PyExtensionType):
   
       def __init__(self):
           pa.PyExtensionType.__init__(self, pa.string())
   
       def __reduce__(self):
           return LabelType, ()
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org