Skip to content

Commit 132bd27

Browse files
pierrot0The TensorFlow Datasets Authors
authored and
The TensorFlow Datasets Authors
committed
Update beam_utils_test to support numpy2
PiperOrigin-RevId: 666805585
1 parent b9b534a commit 132bd27

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tensorflow_datasets/core/beam_utils_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ def test_read_from_tfds(
5151
dummy_dataset, split=split, workers_per_shard=workers_per_shard
5252
)
5353
| beam.Map(dataset_utils.as_numpy)
54+
# Post numpy2, we don't get `{'id': 0}` but
55+
# `{'id': np.int64(0)}`
56+
| beam.Map(lambda x: {'id': int(x['id'])})
5457
| beam.io.WriteToText(os.fspath(tmp_path / 'out.txt'))
5558
)
5659

0 commit comments

Comments
 (0)