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

"findall is ambiguous" error #69

Closed
simonsteiger opened this issue Feb 9, 2024 · 3 comments
Closed

"findall is ambiguous" error #69

simonsteiger opened this issue Feb 9, 2024 · 3 comments

Comments

@simonsteiger
Copy link

While working with BetaML, DataFrames and Chain, I found that importing BetaML leads to ambiguity in findall when working with the @chain macro.

using Chain, DataFrames

import BetaML as BML

df = DataFrame(randn(100, 3), :auto)

# This works
transform(df, All() => ByRow((x...) -> sum(x)) => :y)

# This fails
@chain df begin
	transform(_, All() => ByRow((x...) -> sum(x)) => :y)
end

I am not sure what the correct solution would be. The error log suggests defining findall(::F, ::Array{T}) where {T, F<:Function}, but I am not experienced in managing packages and therefore not sure if one would have to keep other things in mind.

Here is the full error log:

LoadError: MethodError: findall(::Chain.var"#4#5", ::Vector{Any}) is ambiguous.

Candidates:
  findall(testf::Function, A)
    @ Base array.jl:2439
  findall(testf::F, A::AbstractArray) where F<:Function
    @ Base array.jl:2447
  findall(el::T, cont::Array{T}; returnTuple) where T
    @ BetaML.Utils ~/.julia/packages/BetaML/QcevM/src/Utils/Processing.jl:73

Possible fix, define
  findall(::F, ::Array{T}) where {T, F<:Function}
@sylvaticus
Copy link
Owner

hello, thank you to report... I ill look at this, but most likely not earlier than Monday...

@sylvaticus
Copy link
Owner

I think it's my fault, doing what it is called in Julia jargon "type piracy".. my bad, I have removed the old, unused offending functions and I am going to issue a new release of BetaML (v0.11.3), just wait a few minutes and update your project..

@simonsteiger
Copy link
Author

Thanks a lot for the quick help and the great package!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants