(stream_fixture)
| 383 | |
| 384 | @pytest.mark.pandas |
| 385 | def test_stream_write_dispatch(stream_fixture): |
| 386 | # ARROW-1616 |
| 387 | df = pd.DataFrame({ |
| 388 | 'one': np.random.randn(5), |
| 389 | 'two': pd.Categorical(['foo', np.nan, 'bar', 'foo', 'foo'], |
| 390 | categories=['foo', 'bar'], |
| 391 | ordered=True) |
| 392 | }) |
| 393 | table = pa.Table.from_pandas(df, preserve_index=False) |
| 394 | batch = pa.RecordBatch.from_pandas(df, preserve_index=False) |
| 395 | with stream_fixture._get_writer(stream_fixture.sink, table.schema) as wr: |
| 396 | wr.write(table) |
| 397 | wr.write(batch) |
| 398 | |
| 399 | table = (pa.ipc.open_stream(pa.BufferReader(stream_fixture.get_source())) |
| 400 | .read_all()) |
| 401 | assert_frame_equal(table.to_pandas(), |
| 402 | pd.concat([df, df], ignore_index=True)) |
| 403 | |
| 404 | |
| 405 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected