Skip to content

Commit

Permalink
[#3] - Solução do problema dos múltiplos warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Conradox committed Aug 19, 2020
1 parent 13e037c commit 76c4aec
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/modifiers.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@ end
#TODO: Verificar se tem colunas duplicatas
FilterModifier(columns::Symbol...) = FilterModifier([columns...])

EasyWarns = Set()
warn(str::String, warnChecker::Set) = str in warnChecker || (@warn str) === nothing && push!(warnChecker, str)

function apply!(modifier::FilterModifier, data::DataFrame, event::Int)
columns = Symbol[]
for col in modifier.columns
if !(col in propertynames(data))
#TODO: Colocar para avisar somente uma única vez do problema.
@warn "O stream não possui a $col"
warn("O stream não possui a $col", EasyWarns)
else
push!(columns, col)
end
Expand Down

0 comments on commit 76c4aec

Please sign in to comment.