Repository: arrow Updated Branches: refs/heads/master 2ee900c8f -> 3549fa892
ARROW-1683: [Python] Restore TimestampType to pyarrow namespace This is being used in PySpark. After 0.8.0 we should migrate Spark to use the `pyarrow.types` APIs and then remove this from the top level namespace again cc @BryanCutler Author: Wes McKinney <wes.mckin...@twosigma.com> Closes #1229 from wesm/ARROW-1683 and squashes the following commits: 7378d9d9 [Wes McKinney] Restore TimestampType to pyarrow namespace Project: http://git-wip-us.apache.org/repos/asf/arrow/repo Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/3549fa89 Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/3549fa89 Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/3549fa89 Branch: refs/heads/master Commit: 3549fa892ec65d016dbef6645b9daebd392c990d Parents: 2ee900c Author: Wes McKinney <wes.mckin...@twosigma.com> Authored: Sat Oct 21 12:09:19 2017 -0400 Committer: Wes McKinney <wes.mckin...@twosigma.com> Committed: Sat Oct 21 12:09:19 2017 -0400 ---------------------------------------------------------------------- python/pyarrow/__init__.py | 6 +++++- python/pyarrow/tests/test_types.py | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/arrow/blob/3549fa89/python/pyarrow/__init__.py ---------------------------------------------------------------------- diff --git a/python/pyarrow/__init__.py b/python/pyarrow/__init__.py index e37c123..0a1575f 100644 --- a/python/pyarrow/__init__.py +++ b/python/pyarrow/__init__.py @@ -37,7 +37,8 @@ from pyarrow.lib import (null, bool_, 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 @@ from pyarrow.lib import (null, bool_, 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, http://git-wip-us.apache.org/repos/asf/arrow/blob/3549fa89/python/pyarrow/tests/test_types.py ---------------------------------------------------------------------- diff --git a/python/pyarrow/tests/test_types.py b/python/pyarrow/tests/test_types.py index 99cd4d0..d8eea62 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)