codedthinking / Kezdi.jl

Julia package for data manipulation and analysis
https://codedthinking.github.io/Kezdi.jl/
Other
43 stars 2 forks source link

bug: replace does not find user-defined function? #182

Closed korenmiklos closed 2 months ago

korenmiklos commented 2 months ago

Not sure how to reproduce this bug in a minimal example.

Kezdi.jl> @generate id_type = 1 @if left(frame_id, 2) == "ft"

Kezdi.jl> @replace id_type = 2 @if left(frame_id, 2) == "fc"

ERROR: LoadError: ArgumentError: column name :left not found in the data frame
korenmiklos commented 2 months ago
julia> @generate x = 1 @if left(t, 1) == "a"
Kezdi.jl> @generate x = 1 @if left(t, 1) == "a"

3×2 DataFrame
 Row │ t       x
     │ String  Int64?
─────┼─────────────────
   1 │ aa            1
   2 │ bb      missing
   3 │ cc      missing

julia> @replace x = 2 @if left(t, 1) == "b"
Kezdi.jl> @replace x = 2 @if left(t, 1) == "b"

ERROR: ArgumentError: column name :left not found in the data frame
Stacktrace:
 [1] lookupname
   @ ~/.julia/packages/DataFrames/58MUJ/src/other/index.jl:413 [inlined]
 [2] getindex
   @ ~/.julia/packages/DataFrames/58MUJ/src/other/index.jl:422 [inlined]
 [3] getindex(df::DataFrame, ::typeof(!), col_ind::Symbol)
   @ DataFrames ~/.julia/packages/DataFrames/58MUJ/src/dataframe/dataframe.jl:557
 [4] getproperty(df::DataFrame, col_ind::Symbol)
   @ DataFrames ~/.julia/packages/DataFrames/58MUJ/src/abstractdataframe/abstractdataframe.jl:431
 [5] top-level scope
   @ ~/Tresorit/Mac/code/julia/Kezdi.jl/src/commands.jl:56