Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Overload Compat.eachrow and Compat.eachcol #2067

Merged
merged 5 commits into from
Dec 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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