-
Notifications
You must be signed in to change notification settings - Fork 54
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
@transform and @where (maybe more) are broken on v0.7 #88
Comments
@bramtayl saved us last time by porting the macros to 0.6, maybe he has ideas? It would also be interesting to try reproducing the bug directly with |
I dont think theres a macro issue here: julia> MacroTools.prettify(@macroexpand @transform(dd, d = (:b ./ :c)))
:(transform(dd, d=(barracuda->begin
function echidna(lion, dinosaur)
dinosaur ./ lion
end
echidna(barracuda[:c], barracuda[:b])
end))) julia> MacroTools.prettify(@macroexpand @where(dd, :b .>= 0.2, :a .>= Date(1998)))
:(where(dd, (barracuda->begin
function echidna(lion, dinosaur)
(dinosaur .>= 0.2) .& (lion .>= Date(1998))
end
echidna(barracuda[:b], barracuda[:a])
end))) Both seem reasonable to me, meaning the issues are in |
Oh wait the argument order is backwards for where... |
Ok so here's what I'm getting: The order of the arguments for the "ecdina" function come in a random/inconsistent order. These arguments are the keys of the This behavior only appears when with_helper is nested within other functions. That is, this is working consistently for me: :($d -> $(DataFramesMeta.with_helper(d, body))) |> MacroTools.prettify But this is not: DataFramesMeta.with_anonymous(body) |> MacroTools.prettify |
Good catch! AFAIK entries in a dictionary are unordered, but it's guaranteed that |
No it doesn't work on the current Windows nightly. I'm not sure how to figure out when the last time it was working... |
I've found a MWE, filed in Julia as JuliaLang/julia#26359. |
Got an explanation on the Julia issue. #91 should fix it. |
I'm on Julia v0.7 and DataFramesMeta v3.0.0. It appears that
@transform
and@where
are broken. I believe it could be related to some changes tobroadcast
, but most of the work in this package is done in macros which are very unfamiliar to me, so I'm struggling to debug it.@transform
is behaving badly. If I just extract the columns and do something likedf[:c] = df[:a] .+ df[:b]
, I have no issues. Sometimes I get nonsense for the result, sometimes not.@where
sometimes I get an error that really makes no sense given what I'm asking it to do. It seems like it is trying to mix the columns together or something, based on the error I'm seeing. If I do one subset at a time, it works.The text was updated successfully, but these errors were encountered: