[ 
https://issues.apache.org/jira/browse/ARROW-1654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16215687#comment-16215687
 ] 

ASF GitHub Bot commented on ARROW-1654:
---------------------------------------

wesm commented on a change in pull request #1238: ARROW-1654: [Python] 
Implement pickling for DataType, Field, Schema
URL: https://github.com/apache/arrow/pull/1238#discussion_r146365791
 
 

 ##########
 File path: python/pyarrow/tests/test_schema.py
 ##########
 @@ -304,3 +306,37 @@ def test_schema_repr_with_dictionaries():
 two: int32""")
 
     assert repr(sch) == expected
+
+
+def test_type_schema_pickling():
+    cases = [
+        pa.int8(),
+        pa.string(),
+        pa.binary(),
+        pa.binary(10),
+        pa.list_(pa.string()),
+        pa.struct([
+            pa.field('a', 'int8'),
+            pa.field('b', 'string')
+        ]),
+        pa.time32('s'),
+        pa.time64('us'),
+        pa.date32(),
+        pa.date64(),
 
 Review comment:
   thought I had one, let me add

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


> [Python] pa.DataType cannot be pickled
> --------------------------------------
>
>                 Key: ARROW-1654
>                 URL: https://issues.apache.org/jira/browse/ARROW-1654
>             Project: Apache Arrow
>          Issue Type: Improvement
>            Reporter: Li Jin
>            Assignee: Wes McKinney
>              Labels: pull-request-available
>             Fix For: 0.8.0
>
>
> In [26]: t
> Out[26]: DataType(int64)
> In [25]: pickle.dumps(t)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
> <ipython-input-25-f90063f6658b> in <module>()
> ----> 1 pickle.dumps(t)
> /home/icexelloss/miniconda3/envs/spark-dev/lib/python3.5/site-packages/pyarrow/lib.cpython-35m-x86_64-linux-gnu.so
>  in pyarrow.lib.DataType.__reduce_cython__()
> TypeError: no default __reduce__ due to non-trivial __cinit__
> This is discovered when trying to send a pa.DataType along with a udf in 
> pyspark. The workaround is to send pyspark DataType and convert to 
> pa.DataType. It would be nice to able to pickle pa.DataType.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to