You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "AlenkaF (via GitHub)" <gi...@apache.org> on 2023/03/02 12:00:24 UTC

[GitHub] [arrow] AlenkaF commented on a diff in pull request #34275: GH-21761: [Python] Change array constructor to accept pyarrow array

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


##########
python/pyarrow/array.pxi:
##########
@@ -232,6 +232,11 @@ def array(object obj, type=None, mask=None, size=None, from_pandas=None,
     else:
         c_from_pandas = from_pandas
 
+    if isinstance(obj, Array):
+        if type is not None and not obj.type.equals(type):
+            obj = obj.cast(type)

Review Comment:
   To update the thread: as we discussed I will add the change to the `cast()` method to accept `memory_pool` argument as a part of this PR.



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