aosingh commented on code in PR #502:
URL: https://github.com/apache/arrow-nanoarrow/pull/502#discussion_r1628468848


##########
python/tests/test_array.py:
##########
@@ -354,3 +355,87 @@ def test_array_inspect(capsys):
     array.inspect()
     captured = capsys.readouterr()
     assert captured.out.startswith("<ArrowArray struct<col0: int32")
+
+
+def test_timestamp_array(capsys):
+    schema = na.struct(
+        {
+            "creation_timestamp": na.timestamp("ms"),
+        }
+    )
+
+    d1 = int(round(datetime(1985, 12, 31, 0, 0, 
tzinfo=timezone.utc).timestamp() * 1e3))
+    d2 = int(round(datetime(2005, 3, 4, 0, 0, tzinfo=timezone.utc).timestamp() 
* 1e3))
+
+    columns = [
+        na.c_array([d1, d2], na.timestamp("ms")),
+    ]
+
+    c_array = na.c_array_from_buffers(
+        schema, length=columns[0].length, buffers=[None], children=columns
+    )
+    array = na.Array(c_array)
+    names, columns = array.to_columns_pysequence()
+    assert names == ["creation_timestamp"]
+    assert list(array.to_pysequence()) == [
+        {"creation_timestamp": datetime(1985, 12, 31, 0, 0)},
+        {"creation_timestamp": datetime(2005, 3, 4, 0, 0)},
+    ]
+    array.inspect()
+    captured = capsys.readouterr()
+    assert captured.out.startswith(
+        "<ArrowArray struct<creation_timestamp: timestamp('ms'"
+    )
+
+
+def test_pyarrow_table_using_array():

Review Comment:
   Understood, makes sense. I will remove these 2 for now. 



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