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


##########
python/pyarrow/array.pxi:
##########
@@ -339,8 +339,12 @@ def array(object obj, type=None, mask=None, size=None, 
from_pandas=None,
             result = _ndarray_to_array(values, mask, type, c_from_pandas, safe,
                                        pool)
     else:
+        if type and type.id == _Type_RUN_END_ENCODED:
+            from pyarrow.compute import run_end_encode
+            result = run_end_encode(obj)

Review Comment:
   Makes sense!
   Would it be a good approach to keep the compute function to actually get 
`.run_ends` and `.values` and then call 
`RunEndEncodedArray.from_arrays(run_ends, values, ree_type)` with the correct 
ree type? (it shouldn't make a copy at this point)



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