(
ray_start_regular_shared, target_max_block_size_infinite_or_default, tmp_path
)
| 25 | |
| 26 | |
| 27 | def test_json_read( |
| 28 | ray_start_regular_shared, target_max_block_size_infinite_or_default, tmp_path |
| 29 | ): |
| 30 | df1 = pd.DataFrame({"one": [1, 2, 3], "two": ["a", "b", "c"]}) |
| 31 | path1 = os.path.join(tmp_path, "test1.json") |
| 32 | df1.to_json(path1, orient="records", lines=True) |
| 33 | ds = ray.data.read_json(path1) |
| 34 | dsdf = ds.to_pandas() |
| 35 | pd.testing.assert_frame_equal(df1.astype(dsdf.dtypes.to_dict()), dsdf) |
| 36 | # Metadata ops. |
| 37 | assert ds.count() == 3 |
| 38 | assert ds.input_files() == [path1] |
| 39 | assert ds.schema() == Schema(pa.schema([("one", pa.int64()), ("two", pa.string())])) |
| 40 | |
| 41 | |
| 42 | def test_zipped_json_read( |
nothing calls this directly
no test coverage detected
searching dependent graphs…