Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
10.0.0
-
python 3.9
pyarrow 10.0.0
No pandas installed
Description
When creating an array of time64 elements, the array type information is changed from Time64Type to DataType.
While it's not an issue as such, given it still looks like an array of time64, I can't access special attributes of the Time64Type (for example unit)
dtype = pa.time64("ns") time_array = pa.array( [ 1, 2, 3 ], dtype ) assert pa.types.is_time64(time_array.type) is True assert isinstance(dtype, pa.Time64Type) is True assert isinstance(time_array.type, pa.Time64Type) is False # Wrong assert isinstance(time_array.type, pa.DataType) is True # Wrong assert dtype == time_array.type assert dtype.unit == "ns" with pytest.raises(AttributeError, match=r"'pyarrow.lib.DataType' object has no attribute 'unit'"): # Should be able to access unit: time_array.type.unit
Attachments
Issue Links
- links to