(stream_fixture)
| 359 | |
| 360 | @pytest.mark.pandas |
| 361 | def test_stream_write_dispatch(stream_fixture): |
| 362 | # ARROW-1616 |
| 363 | df = pd.DataFrame({ |
| 364 | 'one': np.random.randn(5), |
| 365 | 'two': pd.Categorical(['foo', np.nan, 'bar', 'foo', 'foo'], |
| 366 | categories=['foo', 'bar'], |
| 367 | ordered=True) |
| 368 | }) |
| 369 | table = pa.Table.from_pandas(df, preserve_index=False) |
| 370 | batch = pa.RecordBatch.from_pandas(df, preserve_index=False) |
| 371 | with stream_fixture._get_writer(stream_fixture.sink, table.schema) as wr: |
| 372 | wr.write(table) |
| 373 | wr.write(batch) |
| 374 | |
| 375 | table = (pa.ipc.open_stream(pa.BufferReader(stream_fixture.get_source())) |
| 376 | .read_all()) |
| 377 | assert_frame_equal(table.to_pandas(), |
| 378 | pd.concat([df, df], ignore_index=True)) |
| 379 | |
| 380 | |
| 381 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected