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/04/06 11:18:32 UTC

[GitHub] [arrow] AlenkaF commented on a diff in pull request #12754: ARROW-15429: [Python] Address docstrings for ChunkedArray class, methods, attributes and constructor

AlenkaF commented on code in PR #12754:
URL: https://github.com/apache/arrow/pull/12754#discussion_r843820490


##########
python/pyarrow/table.pxi:
##########
@@ -357,6 +509,29 @@ cdef class ChunkedArray(_PandasConvertible):
         Returns
         -------
         cast : Array or ChunkedArray
+
+        Examples
+        --------
+        >>> import pyarrow as pa
+        >>> n_legs = pa.chunked_array([[2, 2, 4], [4, 5, 100]])
+        >>> n_legs.type
+        DataType(int64)
+        >>> n_legs.cast(pa.duration('s')).type
+        DurationType(duration[s])
+        >>> n_legs.cast(pa.duration('s'))
+        <pyarrow.lib.ChunkedArray object at ...>
+        [
+          [
+            2,
+            2,
+            4
+          ],
+          [
+            4,
+            5,
+            100
+          ]
+        ]

Review Comment:
   Sure, can do. I will also divide the example with text so it will be clearer. What I can also do is remove the last call `>>> n_legs.cast(pa.duration('s'))` altogether.



-- 
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