Skip to content

Commit c2c0b2d

Browse files
authored
Bugfix: callables are now escaped. Updated Julia version to 1.10. (#133)
* Bugfix: callables are now escapaed. Updated Julia version to 1.10. * Update CI.yml
1 parent 86a8ff8 commit c2c0b2d

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

NEWS.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# TidierData.jl updates
22

3+
## v0.16.4 - 2025-01-11
4+
- Bugfix: Only functions in Base, Core, and Statistics are not escaped. All other functions and callables are escaped.
5+
- Updated minimum Julia version to 1.10
6+
37
## v0.16.3 - 2024-12-28
48
- Bugfix: `@summary` no longer errors with non-numeric columns. Instead, it only reports non-numeric summary stats on non-numeric columns. Minor changes to summary column names to be snake_case.
59
- Bugfix: Reverted a bug introduced in v0.13.4, which escaped all macros. Now, string macros remain escaped (i.e., keeping it possible to work with Unitful units, e.g. `u"psi"`), but other macros are *not* escaped to allow for those macros to refer to column names within arguments.

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "TidierData"
22
uuid = "fe2206b3-d496-4ee9-a338-6a095c4ece80"
33
authors = ["Karandeep Singh"]
4-
version = "0.16.3"
4+
version = "0.16.4"
55

66
[deps]
77
Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc"
@@ -20,9 +20,9 @@ DataFrames = "1.5"
2020
MacroTools = "0.5"
2121
Reexport = "0.2, 1"
2222
ShiftedArrays = "2"
23-
Statistics = "1.6"
23+
Statistics = "1.10"
2424
StatsBase = "0.34, 1"
25-
julia = "1.9"
25+
julia = "1.10"
2626

2727
[extras]
2828
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

src/parsing.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -394,20 +394,12 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
394394
return x
395395
elseif fn isa Symbol && hasproperty(Statistics, fn) && typeof(getproperty(Statistics, fn)) <: Function
396396
return x
397-
elseif fn isa Symbol && hasproperty(Base, fn) && typeof(getproperty(Base, fn)) <: Type
398-
return x
399-
elseif fn isa Symbol && hasproperty(Core, fn) && typeof(getproperty(Core, fn)) <: Type
400-
return x
401-
elseif fn isa Symbol && hasproperty(Statistics, fn) && typeof(getproperty(Statistics, fn)) <: Type
402-
return x
403397
elseif contains(string(fn), r"[^\W0-9]\w*$") # valid variable name
404398
return :($(esc(fn))($(args...)))
405399
else
406400
return x
407401
end
408402
elseif @capture(x, fn_.(args__))
409-
# if fn in [:esc :in :∈ :∉ :Ref :Set :Cols :(:) :∘ :across :desc :mean :std :var :median :first :last :minimum :maximum :sum :length :skipmissing :quantile :passmissing :startswith :contains :endswith]
410-
# return x
411403
if fn in not_escaped[]
412404
return x
413405
elseif fn isa Symbol && hasproperty(Base, fn) && typeof(getproperty(Base, fn)) <: Function
@@ -416,12 +408,6 @@ function parse_escape_function(rhs_expr::Union{Expr,Symbol})
416408
return x
417409
elseif fn isa Symbol && hasproperty(Statistics, fn) && typeof(getproperty(Statistics, fn)) <: Function
418410
return x
419-
elseif fn isa Symbol && hasproperty(Base, fn) && typeof(getproperty(Base, fn)) <: Type
420-
return x
421-
elseif fn isa Symbol && hasproperty(Core, fn) && typeof(getproperty(Core, fn)) <: Type
422-
return x
423-
elseif fn isa Symbol && hasproperty(Statistics, fn) && typeof(getproperty(Statistics, fn)) <: Type
424-
return x
425411
elseif contains(string(fn), r"[^\W0-9]\w*$") # valid variable name
426412
return :($(esc(fn)).($(args...)))
427413
else

0 commit comments

Comments
 (0)