Skip to content

Commit 340a5a4

Browse files
authored
Merge pull request #323 from queryverse/backwards-compat
Add dissallowna macro for backwards compat
2 parents 29e2d12 + c263688 commit 340a5a4

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

src/Query.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ export @map, @filter, @groupby, @orderby, @orderby_descending, @unique,
1212

1313
export @select, @rename, @mutate, @disallowna, @dropna, @replacena
1414

15+
# The following is a backwards compat fix
16+
export @dissallowna
17+
1518
export isna, NA
1619

1720
include("query_utils.jl")

src/table_query_macros.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,14 @@ macro disallowna(columns...)
201201
return :( Query.@mutate( $( ( :( $(columns[i].value) = our_get(_.$(columns[i].value)) ) for i=1:length(columns) )... ) ) )
202202
end
203203

204+
# The following is a backwards compat fix
205+
macro dissallowna()
206+
return :( Query.@map(map(our_get, _)) )
207+
end
208+
macro dissallowna(columns...)
209+
return :( Query.@mutate( $( ( :( $(columns[i].value) = our_get(_.$(columns[i].value)) ) for i=1:length(columns) )... ) ) )
210+
end
211+
204212
macro dropna()
205213
return :( i-> i |> Query.@filter(!any(isna, _)) |> Query.@disallowna() )
206214
end

0 commit comments

Comments
 (0)