Skip to content

Commit

Permalink
Merge pull request #1320 from JuliaData/jq/pairs
Browse files Browse the repository at this point in the history
0.7 updates
  • Loading branch information
quinnj authored Dec 19, 2017
2 parents 6a1fa20 + a705587 commit 855c963
Show file tree
Hide file tree
Showing 22 changed files with 29 additions and 21 deletions.
2 changes: 1 addition & 1 deletion REQUIRE
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Reexport
WeakRefStrings 0.4.0
DataStreams 0.3.0
CodecZlib 0.4
Compat 0.36.0
Compat 0.40.0
8 changes: 8 additions & 0 deletions src/DataFrames.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ module DataFrames
using Reexport, StatsBase, SortingAlgorithms, Compat
@reexport using CategoricalArrays, Missings
using Base: Sort, Order
using Compat: pairs

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

##############################################################################
##
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
2 changes: 1 addition & 1 deletion test/cat.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestCat
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
const = isequal

#
Expand Down
2 changes: 1 addition & 1 deletion test/constructors.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestConstructors
using Base.Test, DataFrames, DataFrames.Index
using Compat, Compat.Test, DataFrames, DataFrames.Index
const = isequal

#
Expand Down
2 changes: 1 addition & 1 deletion test/conversions.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestConversions
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
using DataStructures: OrderedDict, SortedDict
const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/data.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestData
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
importall Base # so that we get warnings for conflicts
const = isequal

Expand Down
2 changes: 1 addition & 1 deletion test/dataframe.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestDataFrame
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
const = isequal
const = !isequal

Expand Down
2 changes: 1 addition & 1 deletion test/dataframerow.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestDataFrameRow
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames

df = DataFrame(a=Union{Int, Missing}[1, 2, 3, 1, 2, 2],
b=[2.0, missing, 1.2, 2.0, missing, missing],
Expand Down
2 changes: 1 addition & 1 deletion test/duplicates.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestDuplicates
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
const = isequal

df = DataFrame(a = [1, 2, 3, 3, 4])
Expand Down
2 changes: 1 addition & 1 deletion test/grouping.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestGrouping
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
const = isequal

srand(1)
Expand Down
2 changes: 1 addition & 1 deletion test/index.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestIndex
using Base.Test, DataFrames, DataFrames.Index
using Compat, Compat.Test, DataFrames, DataFrames.Index

i = Index()
push!(i, :A)
Expand Down
2 changes: 1 addition & 1 deletion test/io.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestIO
using Base.Test, DataFrames, CategoricalArrays
using Compat, Compat.Test, DataFrames, CategoricalArrays
using LaTeXStrings

# Test LaTeX export
Expand Down
2 changes: 1 addition & 1 deletion test/iteration.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestIteration
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames

dv = [1, 2, missing]
dm = Union{Int, Missing}[1 2; 3 4]
Expand Down
2 changes: 1 addition & 1 deletion test/join.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestJoin
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames
const = isequal

name = DataFrame(ID = Union{Int, Missing}[1, 2, 3],
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fatalerrors = length(ARGS) > 0 && ARGS[1] == "-f"
quiet = length(ARGS) > 0 && ARGS[1] == "-q"
anyerrors = false

using Base.Test
using Compat, Compat.Test
using DataFrames

my_tests = ["utils.jl",
Expand Down
2 changes: 1 addition & 1 deletion test/show.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestShow
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames

# In the future newline character \n should be added to this test case
df = DataFrame(A = Int64[1:4;], B = ["x\"", "∀ε>0: x+ε>x", "z\$", "ABC"],
Expand Down
2 changes: 1 addition & 1 deletion test/sort.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestSort
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames

dv1 = [9, 1, 8, missing, 3, 3, 7, missing]
dv2 = [9, 1, 8, missing, 3, 3, 7, missing]
Expand Down
2 changes: 1 addition & 1 deletion test/subdataframe.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestSubDataFrame
using Base.Test, DataFrames
using Compat, Compat.Test, DataFrames

@testset "view -- DataFrame" begin
df = DataFrame(x = 1:10, y = 1.0:10.0)
Expand Down
2 changes: 1 addition & 1 deletion test/utils.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module TestUtils
using Base.Test, DataFrames, StatsBase
using Compat, Compat.Test, DataFrames, StatsBase
import DataFrames: identifier

@test identifier("%_B*_\tC*") == :_B_C_
Expand Down

0 comments on commit 855c963

Please sign in to comment.