mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 09:05:47 +08:00
ARROW-7980: [Python] Fix creation of tz-aware datetime dtype on first pandas import
This commit is contained in:
1 parent
de786b7e0c
commit
a022026532
2 files changed
+11
No files matched your search
@@ -159,6 +159,7 @@ cdef class _PandasAPIShim(object):
|
||||
|
||||
@property
|
||||
def datetimetz_type(self):
|
||||
self._check_import()
|
||||
return self._datetimetz_type
|
||||
|
||||
@property
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user