From 7378d9d94304623d0957197d274e9a7329fa3c16 Mon Sep 17 00:00:00 2001 From: Wes McKinney Date: Fri, 20 Oct 2017 22:21:28 -0400 Subject: [PATCH] Restore TimestampType to pyarrow namespace Change-Id: I31bb9924c19012aac5075e4c3c87e8bbf8e21bdf --- python/pyarrow/__init__.py | 6 +++++- python/pyarrow/tests/test_types.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index e37c123d24d..0a1575f0edc 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -37,7 +37,8 @@ float16, float32, float64, binary, string, decimal, list_, struct, dictionary, field, - type_for_alias, DataType, NAType, + type_for_alias, + DataType, NAType, Field, Schema, schema, @@ -67,6 +68,9 @@ DecimalValue, Date32Value, Date64Value, TimestampValue) +# ARROW-1683: Remove after 0.8.0? +from pyarrow.lib import TimestampType + from pyarrow.lib import (HdfsFile, NativeFile, PythonFile, FixedSizeBufferWriter, Buffer, BufferReader, BufferOutputStream, diff --git a/python/pyarrow/tests/test_types.py b/python/pyarrow/tests/test_types.py index 99cd4d0d5fe..d8eea622ccc 100644 --- a/python/pyarrow/tests/test_types.py +++ b/python/pyarrow/tests/test_types.py @@ -132,3 +132,8 @@ def test_is_temporal_date_time_timestamp(): assert not types.is_time(case) assert not types.is_temporal(pa.int32()) + + +def test_timestamp_type(): + # See ARROW-1683 + assert isinstance(pa.timestamp('ns'), pa.TimestampType)