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

0.7 updates #1320

Merged
merged 4 commits into from
Dec 19, 2017
Merged
Show file tree
Hide file tree
Changes from 2 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
4 changes: 4 additions & 0 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
__precompile__(true)
module DataFrames

if !isdefined(Base, :pairs)
pairs(x) = x
Copy link
Member

Choose a reason for hiding this comment

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

This seems like a dangerous definition to have lying around, but I guess it's okay until we stop supporting 0.6.

Copy link
Member

Choose a reason for hiding this comment

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

Yeah. Shouldn't Compat provide something like that, since many packages will have the same problem?

BTW, is Femtocleaner able to remove this kind of isdefined check? Or should we use VERSION checks instead?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure about FemtoCleaner, but pairs will be available in Compat as of 0.40.0: JuliaLang/METADATA.jl#12530

Copy link
Member

Choose a reason for hiding this comment

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

So do we want to use Compat.pairs here rather than a custom method?

Copy link
Member

Choose a reason for hiding this comment

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

I'd say so, now that it's available in Compat. Just have to bump the REQUIRE to 0.40.0.

Copy link
Member Author

Choose a reason for hiding this comment

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

now we might as well wait till Compat gets Unicode since DataFrames show totally breaks w/o it.

Copy link
Member

Choose a reason for hiding this comment

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

Nah, I'd say just add

if VERSION >= v"0.7.0-DEV.2915"
    using Unicode
end

end

##############################################################################
##
## Dependencies
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/io.jl
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ Data.streamfrom(source::DataFrame, ::Type{Data.Field}, ::Type{T}, row, col) wher
Data.streamtypes(::Type{DataFrame}) = [Data.Column, Data.Field]
Data.weakrefstrings(::Type{DataFrame}) = true

allocate(::Type{T}, rows, ref) where {T} = Vector{T}(rows)
allocate(::Type{T}, rows, ref) where {T} = Vector{T}(uninitialized, rows)
allocate(::Type{CategoricalString{R}}, rows, ref) where {R} = CategoricalArray{String, 1, R}(rows)
allocate(::Type{Union{CategoricalString{R}, Missing}}, rows, ref) where {R} = CategoricalArray{Union{String, Missing}, 1, R}(rows)
allocate(::Type{CategoricalValue{T, R}}, rows, ref) where {T, R} =
Expand Down
2 changes: 1 addition & 1 deletion src/abstractdataframe/sort.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ _getcol(x) = x
# Get an Ordering for a single column
###
function ordering(col_ord::UserColOrdering, lt::Function, by::Function, rev::Bool, order::Ordering)
for (k,v) in col_ord.kwargs
for (k,v) in pairs(col_ord.kwargs)
if k == :lt; lt = v
elseif k == :by; by = v
elseif k == :rev; rev = v
Expand Down
2 changes: 1 addition & 1 deletion src/dataframe/dataframe.jl
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ function DataFrame(; kwargs...)
if isempty(kwargs)
DataFrame(Any[], Index())
else
DataFrame((k => v for (k,v) in kwargs)...)
DataFrame((k => v for (k,v) in pairs(kwargs))...)
end
end

Expand Down