From 7db27e5428d7128806408c3c0db85bc71c78f7e1 Mon Sep 17 00:00:00 2001 From: Karandeep Singh Date: Fri, 8 Mar 2024 12:37:52 -0500 Subject: [PATCH] Bumped version to 0.15.1. `n()` pulls a single value and not a vector of values.`rand()` is no longer auto-vectorized. --- NEWS.md | 4 ++++ Project.toml | 2 +- src/TidierData.jl | 4 ++-- src/parsing.jl | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/NEWS.md b/NEWS.md index 99ad440..6180cb8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # TidierData.jl updates +## v0.15.1 - 2024-03-08 +- Bugfix: `n()` pulls a single value and not a vector of values +- `rand()` is no longer auto-vectorized + ## v0.15.0 - 2024-02-25 - Add support for `begin-end` blocks for all macros accepting multiple expressions - Bug fix to add support for expressions inside of `@group_by()`, as in `@group_by(b = a + 1)` diff --git a/Project.toml b/Project.toml index ecfac06..ff2f56b 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "TidierData" uuid = "fe2206b3-d496-4ee9-a338-6a095c4ece80" authors = ["Karandeep Singh"] -version = "0.15.0" +version = "0.15.1" [deps] Chain = "8be319e6-bccf-4806-a6f7-6fae938471bc" diff --git a/src/TidierData.jl b/src/TidierData.jl index 440494a..9b88c1d 100644 --- a/src/TidierData.jl +++ b/src/TidierData.jl @@ -28,11 +28,11 @@ const code = Ref{Bool}(false) # output DataFrames.jl code? const log = Ref{Bool}(false) # output tidylog output? (not yet implemented) # The global do-not-vectorize "list" -const not_vectorized = Ref{Vector{Symbol}}([:esc, :Ref, :Set, :Cols, :collect, :(:), :∘, :lag, :lead, :ntile, :repeat, :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :cumsum, :cumprod, :accumulate, :is_float, :is_integer, :is_string, :cat_rev, :cat_relevel, :cat_infreq, :cat_lump, :cat_reorder, :cat_collapse, :cat_lump_min, :cat_lump_prop, :categorical, :as_categorical, :is_categorical]) +const not_vectorized = Ref{Vector{Symbol}}([:getindex, :rand, :esc, :Ref, :Set, :Cols, :collect, :(:), :∘, :lag, :lead, :ntile, :repeat, :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :cumsum, :cumprod, :accumulate, :is_float, :is_integer, :is_string, :cat_rev, :cat_relevel, :cat_infreq, :cat_lump, :cat_reorder, :cat_collapse, :cat_lump_min, :cat_lump_prop, :categorical, :as_categorical, :is_categorical]) # The global do-not-escape "list" # `in`, `∈`, and `∉` should be vectorized in auto-vec but not escaped -const not_escaped = Ref{Vector{Symbol}}([:where, :esc, :in, :∈, :∉, :Ref, :Set, :Cols, :collect, :(:), :∘, :(=>), :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :startswith, :contains, :endswith]) +const not_escaped = Ref{Vector{Symbol}}([:n, :row_number, :where, :esc, :in, :∈, :∉, :Ref, :Set, :Cols, :collect, :(:), :∘, :(=>), :across, :desc, :mean, :std, :var, :median, :first, :last, :minimum, :maximum, :sum, :length, :skipmissing, :quantile, :passmissing, :startswith, :contains, :endswith]) # Includes include("docstrings.jl") diff --git a/src/parsing.jl b/src/parsing.jl index 667a3c1..b407225 100644 --- a/src/parsing.jl +++ b/src/parsing.jl @@ -446,7 +446,7 @@ function parse_interpolation(var_expr::Union{Expr,Symbol,Number,String}; return :end else found_n = true # do not move this -- this leads to creation of new column - return :TidierData_n + return :(getindex(TidierData_n, 1)) end elseif fn == :row_number found_row_number = true