Tplyr icon indicating copy to clipboard operation
Tplyr copied to clipboard

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

Open mstackhouse opened this issue 3 years ago • 1 comments
trafficstars

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")

mstackhouse avatar Oct 26 '22 16:10 mstackhouse

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

mstackhouse avatar Oct 26 '22 16:10 mstackhouse

@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.

asbates avatar Dec 15 '23 17:12 asbates

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?

mstackhouse avatar Dec 15 '23 17:12 mstackhouse