Skip to content

Commit e160eb7

Browse files
authored
make sure by isa Function or a vector of functions (#2501)
1 parent d23077a commit e160eb7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/abstractdataframe/sort.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ julia> sortperm(df, (:x, :y), rev=true)
473473
"""
474474
function Base.sortperm(df::AbstractDataFrame, cols=[];
475475
alg=nothing, lt=isless, by=identity, rev=false, order=Forward)
476-
if !(isa(by, Function) || eltype(by) <: Function)
476+
if !(by isa Base.Callable || (by isa AbstractVector && eltype(by) <: Base.Callable))
477477
msg = "'by' must be a Function or a vector of Functions. " *
478478
" Perhaps you wanted 'cols'."
479479
throw(ArgumentError(msg))

0 commit comments

Comments
 (0)