Skip to content

Commit d201f79

Browse files
committed
test: reproduce error, split/concat into merge not working
1 parent 0930c14 commit d201f79

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

datastream/datastream.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,3 +525,19 @@ def test_sequential_sampler():
525525
datastream = Datastream(dataset, SequentialSampler(len(dataset)))
526526
it = iter(datastream.data_loader(batch_size=6, n_batches_per_epoch=10))
527527
assert next(it) == ['a', 'b', 'c', 'a', 'b', 'c']
528+
529+
530+
def test_merge_concat():
531+
dataset = Dataset.concat([
532+
Dataset.from_subscriptable([1, 2]),
533+
Dataset.from_subscriptable([1, 3, 5]),
534+
])
535+
536+
datastream = Datastream.merge([
537+
Datastream(dataset),
538+
Datastream(dataset.subset(
539+
lambda df: df["index"] <= 3
540+
)),
541+
])
542+
543+
list(datastream)

0 commit comments

Comments
 (0)