Skip to content

Commit

Permalink
Overload Compat.eachrow and Compat.eachcol (#2067)
Browse files Browse the repository at this point in the history
  • Loading branch information
tkf authored and nalimilan committed Dec 27, 2019
1 parent 7b1ab38 commit baf2740
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ test = ["DataStructures", "DataValues", "Dates", "Logging", "Random", "Test"]
[compat]
julia = "1"
CategoricalArrays = "0.7"
Compat = "2, 3"
Compat = "2.2, 3"
DataAPI = "1.0.1"
InvertedIndices = "1"
IteratorInterfaceExtensions = "0.1.1, 1"
Expand Down
1 change: 1 addition & 0 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export AbstractDataFrame,
if VERSION >= v"1.1.0-DEV.792"
import Base.eachcol, Base.eachrow
else
import Compat.eachcol, Compat.eachrow
export eachcol, eachrow
end

Expand Down
7 changes: 7 additions & 0 deletions test/iteration.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
module TestIteration

import Compat
using Test, DataFrames

df = DataFrame(A = Vector{Union{Int, Missing}}(1:2), B = Vector{Union{Int, Missing}}(2:3))
Expand Down Expand Up @@ -140,4 +141,10 @@ end
end
end

@testset "overload Compat functions" begin
@testset "DataFrames.$f === Compat.$f" for f in intersect(names(DataFrames), names(Compat))
@test getproperty(DataFrames, f) === getproperty(Compat, f)
end
end

end # module

0 comments on commit baf2740

Please sign in to comment.