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