(tempdir, dataset_reader)
| 3587 | |
| 3588 | @pytest.mark.pandas |
| 3589 | def test_json_format(tempdir, dataset_reader): |
| 3590 | table = pa.table({'a': pa.array([1, 2, 3], type="int64"), |
| 3591 | 'b': pa.array([.1, .2, .3], type="float64")}) |
| 3592 | |
| 3593 | path = str(tempdir / 'test.json') |
| 3594 | out = table.to_pandas().to_json(orient='records')[1:-1].replace('},{', '}\n{') |
| 3595 | with open(path, 'w') as f: |
| 3596 | f.write(out) |
| 3597 | |
| 3598 | dataset = ds.dataset(path, format=ds.JsonFileFormat()) |
| 3599 | result = dataset_reader.to_table(dataset) |
| 3600 | assert result.equals(table) |
| 3601 | |
| 3602 | assert_dataset_fragment_convenience_methods(dataset) |
| 3603 | |
| 3604 | dataset = ds.dataset(path, format='json') |
| 3605 | result = dataset_reader.to_table(dataset) |
| 3606 | assert result.equals(table) |
| 3607 | |
| 3608 | |
| 3609 | @pytest.mark.pandas |
nothing calls this directly
no test coverage detected