Skip to content

Commit

Permalink
Handle Base.CanonicalIndexError introduced in Julia 1.8 (#3002)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkamins authored Feb 14, 2022
1 parent e61ab75 commit 2f5536e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion test/indexing_offset.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,12 @@ using Test, DataFrames, OffsetArrays
@test_throws DimensionMismatch df[!, :b] .= ov1

# this is consequence of the fact that OffsetArrays wrap AbstractRange in this case
@test_throws ErrorException df[:, :a] = ov1
# Base.CanonicalIndexError is not available in Julia 1.7 or earlier
if VERSION >= v"1.8-DEV"
@test_throws Base.CanonicalIndexError df[:, :a] = ov1
else
@test_throws ErrorException df[:, :a] = ov1
end

# this inconsistency is the consequence how setindex! for vector is defined in Base
df = DataFrame(a=5:-1:1)
Expand Down

0 comments on commit 2f5536e

Please sign in to comment.