0x26res commented on code in PR #14633:
URL: https://github.com/apache/arrow/pull/14633#discussion_r1021568176
##########
python/pyarrow/tests/test_types.py:
##########
@@ -1131,3 +1131,24 @@ def test_hashing(items):
for i, item in enumerate(items):
assert container[item] == i
+
+
+def test_types_come_back_with_specific_type():
+ for arrow_type in get_many_types():
+ schema = pa.schema([pa.field("field_name", arrow_type)])
+ type_back = schema.field("field_name").type
+ assert type(type_back) is type(arrow_type)
+
+
[email protected]("unit", ["us", "ns"])
+def test_can_read_unit_from_time_64_array(unit: str):
+ array = pa.array([1, 2, 3], pa.time64(unit))
+ assert array.type.unit == unit
+ assert isinstance(array.type, pa.Time64Type)
+
+
[email protected]("unit", ["s", "ms"])
+def test_can_read_unit_from_time_32_array(unit: str):
+ array = pa.array([1, 2, 3], pa.time32(unit))
+ assert array.type.unit == unit
+ assert isinstance(array.type, pa.Time32Type)
Review Comment:
I've removed these 2.
--
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]