Closed chlebowa closed 8 months ago
This is fine with what we stated.
If we have a single selection
, NA
s in data na keep_na = FALSE
, then !is.na(var) & x == var
should be returned.
Check this table https://github.com/insightsengineering/teal.slice/pull/402#issuecomment-1649204484 and this cell
And we later decided to return !is.na(x)
also for multiple selection
> filter_state <- teal.slice:::ChoicesFilterState$new(
+ x = c(LETTERS, NA),
+ slice = teal_slice(varname = "var", dataname = "data", selected = c("A", "B"), keep_na = FALSE)
+ )
> isolate(filter_state$get_call())
!is.na(var) & var %in% c("A", "B")
https://github.com/insightsengineering/teal.slice/pull/402#issuecomment-1659847958
Awesome, thank you :+1:
no worries, thanks for double checking and flaggin!
The
is.na
flag is always added to the filter predicate inFilterState
, which is redundant when specific values are selected. Did we mess something up in https://github.com/insightsengineering/teal.slice/pull/402? I remember the review was thorough, so this may be deliberate but I honestly forget. It doesn't break anything, the calls are valid.