Skip to content

Commit 91102e6

Browse files
committed
bug fix
1 parent a09e1c6 commit 91102e6

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

src/subdataset/subdataset.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ Base.@propagate_inbounds function SubDataset(parent::Dataset, rows::AbstractVect
110110
end
111111
SubDataset(parent, SubIndex(index(parent), cols), rows)
112112
end
113-
Base.@propagate_inbounds function SubDataset(parent::Dataset, rows::AbstractUnitRange, cols)
113+
Base.@propagate_inbounds function SubDataset(parent::Dataset, rows::AbstractRange, cols)
114114
@boundscheck if !checkindex(Bool, axes(parent, 1), rows)
115115
throw(BoundsError(parent, (rows, cols)))
116116
end

test/subdataset.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,4 +312,15 @@ end
312312
sds = view(ds, :, :)
313313
deleteat!(sds, [1,3,5,7,9,11])
314314
@test sds == ds[[2,4,6,8,10,12], :]
315+
316+
317+
ds = Dataset(a = repeat([1, 2, 3, 4], outer=[2]),
318+
b = repeat([2, 1], outer=[4]),
319+
c = 1:8)
320+
setformat!(ds, 1=>iseven)
321+
ds_c = copy(ds)
322+
sds = view(ds, 8:-1:1, [1,3])
323+
deleteat!(sds, 1:4)
324+
@test sds == ds[[4,3,2,1], [1,3]]
325+
@test ds_c == ds
315326
end

0 commit comments

Comments
 (0)