codedthinking / Kezdi.jl

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

bug: functions in other modules cannot be used #133

Closed korenmiklos closed 2 months ago

korenmiklos commented 3 months ago
julia> using Dates
julia> @with getdf() @generate fyear = Dates.year(founding_date)
ERROR: LoadError: UndefVarError: `Dates` not defined
Stacktrace:
korenmiklos commented 2 months ago
julia> @with DataFrame(x = 1:10) @generate y = SpecialFunctions.gamma(x)
ERROR: LoadError: UndefVarError: `SpecialFunctions` not defined
korenmiklos commented 2 months ago

I cannot introspect modules that are not loaded by Kezdi.jl directly, because they are not yet loaded at compile time. Statistics.mean() works, but Dates.year() does not.

korenmiklos commented 2 months ago

Indeed, Dates.year() also works after I import Dates within Kezdi.jl.

korenmiklos commented 2 months ago

Also check functions defined in Main.

julia> my_function(x) = x^2
my_function (generic function with 1 method)

julia> @generate e2 = my_function(AWARD_VALUE_EURO)
ERROR: LoadError: UndefVarError: `my_function` not defined

julia> @generate e2 = Main.my_function(AWARD_VALUE_EURO)
1098451×12 DataFrame