{"action":"created","issue":{"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/88","repository_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl","labels_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/88/labels{/name}","comments_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/88/comments","events_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/88/events","html_url":"https://github.com/JuliaStats/DataFramesMeta.jl/issues/88","id":294832054,"number":88,"title":"@transform and @where (maybe more) are broken on v0.7","user":{"login":"tbeason","id":10752449,"avatar_url":"https://avatars0.githubusercontent.com/u/10752449?v=4","gravatar_id":"","url":"https://api.github.com/users/tbeason","html_url":"https://github.com/tbeason","followers_url":"https://api.github.com/users/tbeason/followers","following_url":"https://api.github.com/users/tbeason/following{/other_user}","gists_url":"https://api.github.com/users/tbeason/gists{/gist_id}","starred_url":"https://api.github.com/users/tbeason/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tbeason/subscriptions","organizations_url":"https://api.github.com/users/tbeason/orgs","repos_url":"https://api.github.com/users/tbeason/repos","events_url":"https://api.github.com/users/tbeason/events{/privacy}","received_events_url":"https://api.github.com/users/tbeason/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2018-02-06T16:49:10Z","updated_at":"2018-02-10T07:02:30Z","closed_at":null,"author_association":"NONE","body":"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 to `broadcast`, 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. \r\n\r\n- [ ] `@transform` is behaving badly. If I just extract the columns and do something like `df[:c] = df[:a] .+ df[:b]`, I have no issues. Sometimes I get nonsense for the result, sometimes not.\r\n```\r\njulia> dd = DataFrame(a=[1,1,1,1,1,2,2,2,2,2],b=rand(10),c=rand(10))\r\n10×3 DataFrame\r\n│ Row │ a │ b         │ c          │\r\n├─────┼───┼───────────┼────────────┤\r\n│ 1   │ 1 │ 0.940118  │ 0.00203923 │\r\n│ 2   │ 1 │ 0.443475  │ 0.600234   │\r\n│ 3   │ 1 │ 0.958618  │ 0.984405   │\r\n│ 4   │ 1 │ 0.657766  │ 0.826958   │\r\n│ 5   │ 1 │ 0.0482096 │ 0.249115   │\r\n│ 6   │ 2 │ 0.903136  │ 0.27147    │\r\n│ 7   │ 2 │ 0.319808  │ 0.697216   │\r\n│ 8   │ 2 │ 0.0525784 │ 0.890392   │\r\n│ 9   │ 2 │ 0.223741  │ 0.978436   │\r\n│ 10  │ 2 │ 0.297486  │ 0.176859   │\r\n\r\njulia> dd[:b] ./ dd[:c]\r\n10-element Array{Float64,1}:\r\n 461.0164605051064\r\n   0.7388362802425429\r\n   0.9738049508515227\r\n   0.7954040678869911\r\n   0.19352378037309087\r\n   3.3268399796579144\r\n   0.4586931077205082\r\n   0.059050832041258175\r\n   0.22867234620825236\r\n   1.6820560963139088\r\n\r\njulia> @transform(dd, d = (:b ./ :c))\r\n10×4 DataFrame\r\n│ Row │ a │ b         │ c          │ d         │\r\n├─────┼───┼───────────┼────────────┼───────────┤\r\n│ 1   │ 1 │ 0.940118  │ 0.00203923 │ 461.016   │\r\n│ 2   │ 1 │ 0.443475  │ 0.600234   │ 0.738836  │\r\n│ 3   │ 1 │ 0.958618  │ 0.984405   │ 0.973805  │\r\n│ 4   │ 1 │ 0.657766  │ 0.826958   │ 0.795404  │\r\n│ 5   │ 1 │ 0.0482096 │ 0.249115   │ 0.193524  │\r\n│ 6   │ 2 │ 0.903136  │ 0.27147    │ 3.32684   │\r\n│ 7   │ 2 │ 0.319808  │ 0.697216   │ 0.458693  │\r\n│ 8   │ 2 │ 0.0525784 │ 0.890392   │ 0.0590508 │\r\n│ 9   │ 2 │ 0.223741  │ 0.978436   │ 0.228672  │\r\n│ 10  │ 2 │ 0.297486  │ 0.176859   │ 1.68206   │\r\n\r\njulia> @transform(dd, d = (:b ./ :c))\r\n10×4 DataFrame\r\n│ Row │ a │ b         │ c          │ d          │\r\n├─────┼───┼───────────┼────────────┼────────────┤\r\n│ 1   │ 1 │ 0.940118  │ 0.00203923 │ 0.00216912 │\r\n│ 2   │ 1 │ 0.443475  │ 0.600234   │ 1.35348    │\r\n│ 3   │ 1 │ 0.958618  │ 0.984405   │ 1.0269     │\r\n│ 4   │ 1 │ 0.657766  │ 0.826958   │ 1.25722    │\r\n│ 5   │ 1 │ 0.0482096 │ 0.249115   │ 5.16732    │\r\n│ 6   │ 2 │ 0.903136  │ 0.27147    │ 0.300586   │\r\n│ 7   │ 2 │ 0.319808  │ 0.697216   │ 2.18011    │\r\n│ 8   │ 2 │ 0.0525784 │ 0.890392   │ 16.9346    │\r\n│ 9   │ 2 │ 0.223741  │ 0.978436   │ 4.37307    │\r\n│ 10  │ 2 │ 0.297486  │ 0.176859   │ 0.59451    │\r\n```\r\n\r\n- [ ]  When using `@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.\r\n```\r\njulia> dd = DataFrame(a = [Date(1998),Date(1999),Date(2000)],b=rand(3))\r\n3×2 DataFrame\r\n│ Row │ a          │ b        │\r\n├─────┼────────────┼──────────┤\r\n│ 1   │ 1998-01-01 │ 0.100379 │\r\n│ 2   │ 1999-01-01 │ 0.516064 │\r\n│ 3   │ 2000-01-01 │ 0.541581 │\r\n\r\njulia> @where(dd, :b .>= 0.2, :a .>= Date(1998))\r\nERROR: MethodError: no method matching isless(::Float64, ::Date)\r\nClosest candidates are:\r\n  isless(::Float64, ::Float64) at float.jl:457\r\n  isless(::Missing, ::Any) at missing.jl:62\r\n  isless(::AbstractFloat, ::AbstractFloat) at operators.jl:124\r\n  ...\r\nStacktrace:\r\n [1] <(::Float64, ::Date) at .\\operators.jl:227\r\n [2] <= at .\\operators.jl:273 [inlined]\r\n [3] >= at .\\operators.jl:297 [inlined]\r\n [4] (::getfield(, Symbol(\"##331#334\")))(::Date, ::Float64, ::Date) at .\\<missing>:0\r\n [5] broadcast_nonleaf(::Function, ::Base.Broadcast.VectorStyle, ::Type{Union{}}, ::Tuple{Base.OneTo{Int64}}, ::Array{Date,1}, ::Vararg{Any,N} where N) at .\\broadcast.jl:649\r\n [6] broadcast(::Function, ::Base.Broadcast.VectorStyle, ::Type{Union{}}, ::Tuple{Base.OneTo{Int64}}, ::Array{Date,1}, ::Array{Float64,1}, ::Vararg{Any,N} where N) at .\\broadcast.jl:626\r\n [7] broadcast at .\\broadcast.jl:618 [inlined]\r\n [8] broadcast at .\\broadcast.jl:615 [inlined]\r\n [9] (::getfield(, Symbol(\"###1843#333\")))(::Array{Float64,1}, ::Array{Date,1}) at C:\\Users\\tbeason\\.julia\\v0.7\\DataFramesMeta\\src\\DataFramesMeta.jl:70\r\n [10] (::getfield(, Symbol(\"##330#332\")))(::DataFrame) at C:\\Users\\tbeason\\.julia\\v0.7\\DataFramesMeta\\src\\DataFramesMeta.jl:72\r\n [11] where(::DataFrame, ::getfield(, Symbol(\"##330#332\"))) at C:\\Users\\tbeason\\.julia\\v0.7\\DataFramesMeta\\src\\DataFramesMeta.jl:194\r\n [12] top-level scope\r\n```"},"comment":{"url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/comments/364631616","html_url":"https://github.com/JuliaStats/DataFramesMeta.jl/issues/88#issuecomment-364631616","issue_url":"https://api.github.com/repos/JuliaStats/DataFramesMeta.jl/issues/88","id":364631616,"user":{"login":"bramtayl","id":9466324,"avatar_url":"https://avatars3.githubusercontent.com/u/9466324?v=4","gravatar_id":"","url":"https://api.github.com/users/bramtayl","html_url":"https://github.com/bramtayl","followers_url":"https://api.github.com/users/bramtayl/followers","following_url":"https://api.github.com/users/bramtayl/following{/other_user}","gists_url":"https://api.github.com/users/bramtayl/gists{/gist_id}","starred_url":"https://api.github.com/users/bramtayl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bramtayl/subscriptions","organizations_url":"https://api.github.com/users/bramtayl/orgs","repos_url":"https://api.github.com/users/bramtayl/repos","events_url":"https://api.github.com/users/bramtayl/events{/privacy}","received_events_url":"https://api.github.com/users/bramtayl/received_events","type":"User","site_admin":false},"created_at":"2018-02-10T07:02:30Z","updated_at":"2018-02-10T07:02:30Z","author_association":"CONTRIBUTOR","body":"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..."}}
{"actor":{"display_login":"bramtayl"}}