// Since order is non deterministic, we need to sort results by id
results_1.sort(key=lambda x: x["id"])
results_2.sort(key=lambda x: x["id"])
expected.sort(key=lambda x: x["id"])
np.testing.assert_equal(expected, results_1)
np.testing.assert_equal(results_1, results_2)
After Change
with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader:
with reader_factory(synthetic_dataset.url, cur_shard=0, shard_count=5) as reader_2:
results_1 = set(_readout_all_ids(reader))
results_2 = set(_readout_all_ids(reader_2))
assert results_1, "Non empty shard expected"
np.testing.assert_equal(results_1, results_2)