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 2020/07/08 15:19:13 UTC

[GitHub] [arrow] kszucs commented on a change in pull request #7684: ARROW-9374: [C++][Python] Expose MakeArrayFromScalar [WIP]

kszucs commented on a change in pull request #7684:
URL: https://github.com/apache/arrow/pull/7684#discussion_r451626479



##########
File path: python/pyarrow/tests/test_array.py
##########
@@ -297,6 +297,24 @@ def test_nulls(ty):
         assert arr.type == ty
 
 
+@pytest.mark.parametrize(('value', 'size', 'expected'), [
+    (None, 1, pa.array([None])),
+    (None, 10, pa.nulls(10)),
+    (-1, 3, pa.array([-1, -1, -1], type=pa.int64())),
+    (2.71, 2, pa.array([2.71, 2.71], type=pa.float64())),
+    ("string", 4, pa.array(["string"] * 4)),
+    (pa.scalar(8, type=pa.uint8()), 17, pa.array([8] * 17, type=pa.uint8())),
+    (pa.scalar(None), 3, pa.array([None, None, None])),
+    (pa.scalar(True), 11, pa.array([True] * 11)),
+    (False, 9, pa.array([False] * 9)),
+    # ([1, 2], 2, pa.array([[1, 2], [1, 2]]))

Review comment:
       The C++ implementation is not complete, so I'm going to extend its type support.




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

For queries about this service, please contact Infrastructure at:
users@infra.apache.org