Skip to content

Commit

Permalink
Allow Expr as custom units in DataFrame header
Browse files Browse the repository at this point in the history
  • Loading branch information
tomyun committed Apr 17, 2024
1 parent bdcc451 commit 5e96f25
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/unit.jl
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ unitfy(df::AbstractDataFrame; kw...) = begin
s = m.captures[2]
#HACK: assume type constructor if the label starts with `:`
if startswith(s, ":")
e = Symbol(s[2:end])
e = Meta.parse(s[2:end])
#HACK: use Main scope for type constructor evaluation
#TODO: remove fallback eval in favor of explict constructor mapping
haskey(D, e) ? D[e] : Main.eval(e)
Expand Down

0 comments on commit 5e96f25

Please sign in to comment.