Skip to content

Commit

Permalink
Merge pull request #183 from codedthinking/0.5-dev
Browse files Browse the repository at this point in the history
0.5 dev
  • Loading branch information
korenmiklos authored Jul 26, 2024
2 parents f4b24ae + 61323b7 commit 8e4b399
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Kezdi"
uuid = "48308a23-c29e-446c-b4c0-d9446a767439"
authors = ["Miklos Koren <[email protected]>", "Gergely Attila Kiss <[email protected]>"]
version = "0.5.0"
version = "0.5.1"

[deps]
CSV = "336ed68f-0bac-5ca0-87d4-7b16caf5d00b"
Expand Down
2 changes: 1 addition & 1 deletion src/commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions test/commands.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e4b399

Please sign in to comment.