We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c526a17 commit 0a2ddd6Copy full SHA for 0a2ddd6
tests/tools/test_process_data.py
@@ -182,12 +182,16 @@ def test_ray_image(self):
182
183
self.assertTrue(osp.exists(tmp_out_path))
184
185
- import ray
186
- res_ds = ray.data.read_json(tmp_out_path)
187
- res_ds = res_ds.to_pandas().to_dict(orient='records')
188
-
189
- self.assertEqual(len(res_ds), 3)
190
- for item in res_ds:
+ from datasets import load_dataset
+ jsonl_files = [os.path.join(tmp_out_path, f) \
+ for f in os.listdir(tmp_out_path) \
+ if f.endswith('.json')]
+ dataset = load_dataset(
+ 'json',
191
+ data_files={'jsonl': jsonl_files})
192
+
193
+ self.assertEqual(len(dataset['jsonl']), 3)
194
+ for item in dataset['jsonl']:
195
self.assertIn('aspect_ratios', item['__dj__stats__'])
196
197
0 commit comments