| 381 | |
| 382 | @pytest.mark.filterwarnings("ignore:Passing a BlockManager:DeprecationWarning") |
| 383 | def test_arrow_from_string(using_infer_string): |
| 384 | # not roundtrip, but starting with pyarrow table without pandas metadata |
| 385 | pa = pytest.importorskip("pyarrow") |
| 386 | table = pa.table({"a": pa.array(["a", "b", None], type=pa.string())}) |
| 387 | |
| 388 | result = table.to_pandas() |
| 389 | |
| 390 | if not using_infer_string: |
| 391 | if pa_version_under19p0: |
| 392 | expected = pd.DataFrame({"a": ["a", "b", None]}, dtype="object") |
| 393 | else: |
| 394 | expected = pd.DataFrame( |
| 395 | {"a": ["a", "b", None]}, dtype=pd.StringDtype(na_value=np.nan) |
| 396 | ) |
| 397 | elif pa_version_under19p0: |
| 398 | expected = pd.DataFrame({"a": ["a", "b", None]}, dtype="object") |
| 399 | else: |
| 400 | expected = pd.DataFrame({"a": ["a", "b", None]}, dtype="str") |
| 401 | tm.assert_frame_equal(result, expected) |
| 402 | |
| 403 | |
| 404 | @pytest.mark.filterwarnings("ignore:Passing a BlockManager:DeprecationWarning") |