ARROW-7980: [Python] Fix creation of tz-aware datetime dtype on first pandas import

This commit is contained in:
Joris Van den Bossche committed 2020-03-03 15:03:38 +01:00
1 parent de786b7e0c
commit a022026532
2 files changed
+11

No files matched your search

+1
View File
@@ -159,6 +159,7 @@ cdef class _PandasAPIShim(object):
@property
def datetimetz_type(self):
self._check_import()
return self._datetimetz_type
@property
+10
View File
@@ -70,6 +70,16 @@ def test_type_to_pandas_dtype():
assert arrow_type.to_pandas_dtype() == numpy_type
@pytest.mark.pandas
def test_type_to_pandas_dtype2():
# the types where to_pandas_dtype returns a non-numpy dtype
cases = [
(pa.timestamp('ns', tz='UTC'), "datetime64[ns, UTC]"),
]
for arrow_type, pandas_type in cases:
assert str(arrow_type.to_pandas_dtype()) == pandas_type
def test_type_list():
value_type = pa.int32()
list_type = pa.list_(value_type)