-
Notifications
You must be signed in to change notification settings - Fork 367
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
Changes from 2 commits
ca33d56
adc634a
c35ee8d
c3444ea
9f1d862
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,9 @@ using Reexport, SortingAlgorithms, Compat, Unicode, PooledArrays, DataAPI | |
using Base.Sort, Base.Order, Base.Iterators | ||
using Tables, TableTraits, IteratorInterfaceExtensions | ||
|
||
import DataAPI.All, | ||
import Compat.eachcol, | ||
Compat.eachrow, | ||
DataAPI.All, | ||
DataAPI.Between, | ||
DataAPI.describe, | ||
Tables.columnindex, | ||
|
@@ -50,9 +52,7 @@ export AbstractDataFrame, | |
unique!, | ||
unstack | ||
|
||
if VERSION >= v"1.1.0-DEV.792" | ||
import Base.eachcol, Base.eachrow | ||
else | ||
if VERSION < v"1.1.0-DEV.792" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two questions as I do not know Compat.jl well enough:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
My understanding is that
I don't think it matters since if VERSION < v"1.1.0-DEV.792"
import Base: eachcol, eachrow
else
import Compat: eachcol, eachrow
end makes sense if you want to play on the very safe side. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I pushed the change I just suggested 9f1d862. Let me know if you want to revert it. |
||
export eachcol, eachrow | ||
end | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
module TestCompat | ||
tkf marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
import Compat, DataFrames | ||
using Test | ||
|
||
@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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
eachrow
andeachcol
need Compat 2.2: https://github.com/JuliaLang/Compat.jl/releases/tag/v2.2.0