(ray_start_regular_shared, tmp_path)
| 80 | |
| 81 | |
| 82 | def test_numpy_roundtrip(ray_start_regular_shared, tmp_path): |
| 83 | tensor_type = DataContext.get_current().arrow_fixed_shape_tensor_format.to_type() |
| 84 | |
| 85 | ds = ray.data.range_tensor(10, override_num_blocks=2) |
| 86 | ds.write_numpy(tmp_path, column="data") |
| 87 | ds = ray.data.read_numpy(tmp_path) |
| 88 | assert ds.count() == 10 |
| 89 | assert ds.schema() == Schema(pa.schema([("data", tensor_type((1,), pa.int64()))])) |
| 90 | assert sorted(ds.take_all(), key=lambda row: row["data"]) == [ |
| 91 | {"data": np.array([i])} for i in range(10) |
| 92 | ] |
| 93 | |
| 94 | |
| 95 | def test_numpy_read_x(ray_start_regular_shared, tmp_path): |
nothing calls this directly
no test coverage detected
searching dependent graphs…