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

瀏覽次數:101 次
跳到第一則未讀訊息

K leo

未讀,
2016年9月25日 上午9:15:572016/9/25
收件者: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

未讀,
2016年9月28日 清晨5:47:032016/9/28
收件者: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

未讀,
2016年9月28日 清晨7:44:202016/9/28
收件者:julia-users
Thanks for the reply.  Then this is an issue in DataFrames.

Stefan Karpinski

未讀,
2016年9月28日 中午12:31:262016/9/28
收件者: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

未讀,
2016年9月28日 中午12:52:092016/9/28
收件者: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
> >
> >
> >
回覆所有人
回覆作者
轉寄
0 則新訊息