atorus-research / Tplyr

Home Page:https://atorus-research.github.io/Tplyr/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`get_meta_result()` and `get_meta_subset()` should gracefully error with invalid ellipsis params

mstackhouse opened this issue · comments

t <- tplyr_table(adsl, TRT01P) %>% 
  add_layer(
    group_count(AGEGR1, by = vars("Age Group by Sex n (%)", SEX))
  ) 

dat <- t %>% 
  build(metadata=TRUE)

get_meta_result(t, "c1_1", "var1_Placebo", "var1_Xanomeline High Dose")

This should throw an error because of invalid ellipsis content, but instead the ellipsis is just discarded and no error is encountered.

@mstackhouse Should this be an error or a warning? I would think warning because it's not wrong per se but they should know the dots are ignored.

I lean towards error because the syntax is technically wrong. If the syntax is right but the behavior is potentially unexpected, I'd want to warn - but there's not a reason you should leave the invalid syntax so I just want refuse to let the action happen. Does that make sense?