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


##########
python/pyarrow/array.pxi:
##########
@@ -336,11 +336,27 @@ def array(object obj, type=None, mask=None, size=None, 
from_pandas=None,
             if pandas_api.have_pandas:
                 values, type = pandas_api.compat.get_datetimetz_type(
                     values, obj.dtype, type)
-            result = _ndarray_to_array(values, mask, type, c_from_pandas, safe,
-                                       pool)
+            if type and type.id == _Type_RUN_END_ENCODED:
+                if mask is not None:
+                    raise ValueError("Cannot pass a mask for Run-End Encoded 
arrays.")
+                from pyarrow.compute import run_end_encode
+                ree_arr = run_end_encode(obj)
+                result = RunEndEncodedArray.from_arrays(
+                    ree_arr.run_ends.to_pylist(), ree_arr.values.to_pylist(), 
type)

Review Comment:
   Is it worth moving this into its own function to avoid duplication?



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