"both DataArrays and StatsBase export "rle"; uses of it in module DataFrames must be qualified"

101 views
Skip to first unread message

K leo

unread,
Sep 25, 2016, 9:15:57 AM9/25/16
to julia-users
I get a few warning messages like this often.  Does it mean that DataFrames package need to be updated, or that I need to do something in my user code?

Patrick Kofod Mogensen

unread,
Sep 28, 2016, 5:47:03 AM9/28/16
to julia-users
As the error says, they both export a function called rle, so it is not possible to know which one you're trying to call, if you don't qualify them. Qualifying means writing "package name dot" and then the function, as seen below

module A
export f
f
(x::Int64) = x
end

module B
export f
f
(x::Int64) = x+1
end

using A, B

f
(3) # error
A
.f(3) # returns x = 3
B
.f(3) # returns x + 1 = 3 + 1

K leo

unread,
Sep 28, 2016, 7:44:20 AM9/28/16
to julia-users
Thanks for the reply.  Then this is an issue in DataFrames.

Stefan Karpinski

unread,
Sep 28, 2016, 12:31:26 PM9/28/16
to Julia Users
It's not an issue with either package: when there are two things with the same name, you need to be explicit about which one you want to use, either by qualify how you refer to is or by explicitly importing one of the two things with that name.

Milan Bouchet-Valat

unread,
Sep 28, 2016, 12:52:09 PM9/28/16
to julia...@googlegroups.com
Le mercredi 28 septembre 2016 à 04:44 -0700, K leo a écrit :
> Thanks for the reply.  Then this is an issue in DataFrames.
Yes, but one that is already fixed in master by removing the dependency
on DataArrays.


Regards

> > As the error says, they both export a function called rle, so it is
> > not possible to know which one you're trying to call, if you don't
> > qualify them. Qualifying means writing "package name dot" and then
> > the function, as seen below
> >
> > module A
> > export f
> > f(x::Int64) = x
> > end
> >
> > module B
> > export f
> > f(x::Int64) = x+1
> > end
> >
> > using A, B
> >
> > f(3) # error
> > A.f(3) # returns x = 3
> > B.f(3) # returns x + 1 = 3 + 1
> >
> >
> >
Reply all
Reply to author
Forward
0 new messages