From 89a0c24d57681d422dbb66d8d1f1366e72683e63 Mon Sep 17 00:00:00 2001 From: Yue Zhang Date: Wed, 2 Dec 2026 15:59:18 +0800 Subject: [PATCH] test(python): exercise the fixed batch sampler in the distributed loader test Problem The integration worker passes a row count and batch size to the dataset scan sampler, so it fails before checking any DataLoader batches. Solution Construct ShardedFixedBatchSampler, the index-batch iterator expected by the DataLoader and the existing assertions. Result The worker can compare each returned ID and check the total per rank. --- python/python/tests/test_sampler.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/python/tests/test_sampler.py b/python/python/tests/test_sampler.py index eb2fc081040..1a80a8b1ea1 100644 --- a/python/python/tests/test_sampler.py +++ b/python/python/tests/test_sampler.py @@ -198,7 +198,7 @@ def _distributed_test_worker(rank, world_size, dataset_path): dataset = lance.dataset(dataset_path) assert len(dataset) == TEST_CONFIG["total_rows"] - sampler = ShardedBatchSampler( + sampler = ShardedFixedBatchSampler( rank=rank, world_size=world_size, total_num_rows=TEST_CONFIG["total_rows"],