kou commented on a change in pull request #8887:
URL: https://github.com/apache/arrow/pull/8887#discussion_r543798465
##########
File path: python/pyarrow/tests/test_pandas.py
##########
@@ -4001,6 +4011,22 @@ def test_to_pandas_extension_dtypes_mapping():
assert isinstance(result['a'].dtype, pd.PeriodDtype)
+def test_array_to_pandas():
+ if LooseVersion(pd.__version__) < "1.0":
+ pytest.skip("ExtensionDtype __from_arrow__ protocol missing")
+
+ for arr in [pd.period_range("2012-01-01", periods=3, freq="D").array,
+ pd.interval_range(1, 4).array]:
+ result = pa.array(arr).to_pandas()
+ expected = pd.Series(arr)
+ tm.assert_series_equal(result, expected)
+
+ # TODO implement proper conversion for chunked array
+ # result = pa.table({"col": arr})["col"].to_pandas()
+ # expected = pd.Series(arr, name="col")
+ # tm.assert_series_equal(result, expected)
Review comment:
This test is failed on `wheel-manylinux*-cp{36,37}*`:
https://dev.azure.com/ursa-labs/crossbow/_build/results?buildId=21715&view=logs&j=0da5d1d9-276d-5173-c4c4-9d4d4ed14fdb&t=3367cfe7-6aa5-5a88-c888-e6814d74f6eb&l=176
```text
def test_array_to_pandas():
if LooseVersion(pd.__version__) < "1.0":
pytest.skip("ExtensionDtype __from_arrow__ protocol missing")
for arr in [pd.period_range("2012-01-01", periods=3, freq="D").array,
pd.interval_range(1, 4).array]:
result = pa.array(arr).to_pandas()
expected = pd.Series(arr)
> tm.assert_series_equal(result, expected)
E AssertionError: Attributes of Series are different
E
E Attribute "dtype" are different
E [left]: int64
E [right]: period[D]
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]