diff --git a/Project.toml b/Project.toml index 147cf77..5c5ef12 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Kezdi" uuid = "48308a23-c29e-446c-b4c0-d9446a767439" authors = ["Miklos Koren ", "Gergely Attila Kiss "] -version = "0.5.0" +version = "0.5.1" [deps] CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b" diff --git a/src/commands.jl b/src/commands.jl index faac0f8..abaf4f5 100644 --- a/src/commands.jl +++ b/src/commands.jl @@ -31,7 +31,7 @@ function rewrite(::Val{:replace}, command::Command) target_column = get_LHS(command.arguments[1]) LHS, RHS = split_assignment(arguments[1]) third_vector = gensym() - bitmask = build_bitmask(local_copy, vectorize_function_calls(replace_column_references(local_copy, command.condition))) + bitmask = build_bitmask(local_copy, command.condition) quote !($target_column in names(getdf())) && ArgumentError("Column \"$($target_column)\" does not exist in $(names(getdf()))") |> throw $setup diff --git a/test/commands.jl b/test/commands.jl index 0a601fd..952d698 100644 --- a/test/commands.jl +++ b/test/commands.jl @@ -112,6 +112,11 @@ end @testset "Error handling" begin @test_throws Exception @with df @replace y = 1 end + + @testset "Double vectorization bug (#182)" begin + positive(x) = x > 0 + @test (@with DataFrame(x=1:4, y=5:8) @replace y = 0 @if positive(x - 2)).y == [5, 6, 0, 0] + end end @testset "Missing values" begin