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


##########
python/pyarrow/array.pxi:
##########
@@ -2851,6 +2851,103 @@ cdef class StructArray(Array):
         return self.take(indices)
 
 
+cdef class RunEndEncodedArray(Array):
+    """
+    Concrete class for Arrow run-end encoded arrays.
+    """
+
+    @staticmethod
+    def from_arrays(logical_length, run_ends, values, type=None):
+        """
+        Construct RunEndEncodedArray from run_ends and values arrays.
+
+        Parameters
+        ----------
+        logical_length : int
+            The logical length of the run-end encoded array.

Review Comment:
   > I can't simply take `run_ends[-1]` without also checking the physical 
length of `values`.
   
   That's a check that happens anyway? 
   
   ```
   In [49]: pc.run_end_decode(pa.RunEndEncodedArray.from_arrays(8, [2, 5, 7, 
8], [1, 2, 3]))
   ...
   ArrowInvalid: Values array has to be at least as long as run ends array
   
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to