jorisvandenbossche commented on code in PR #49247:
URL: https://github.com/apache/arrow/pull/49247#discussion_r3020794747
##########
python/pyarrow/tests/test_pandas.py:
##########
@@ -3231,13 +3237,19 @@ def test_convert_empty_table(self):
empty_objects = pd.Series(np.array([], dtype=object))
tm.assert_series_equal(arr.to_pandas(),
pd.Series(np.array([], dtype=np.int64)))
- arr = pa.array([], type=pa.string())
- tm.assert_series_equal(arr.to_pandas(), empty_objects)
arr = pa.array([], type=pa.list_(pa.int64()))
tm.assert_series_equal(arr.to_pandas(), empty_objects)
arr = pa.array([], type=pa.struct([pa.field('a', pa.int64())]))
tm.assert_series_equal(arr.to_pandas(), empty_objects)
+ arr = pa.array([], type=pa.string())
+ if Version(pd.__version__) >= Version("3.0.0"):
+ # PyArrow backed string dtype are set by default
+ empty_str = pd.Series(np.array([], dtype=str))
Review Comment:
```suggestion
empty_str = pd.Series([], dtype=str)
```
(slightly cleaner, because the numpy str dtype is something else than the
pandas one (it will result in the same series, since pandas will convert the
numpy str dtype to its own, but no reason to make that indirection here in the
test ;))
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]