rstudio / dbtest

Automates testing of vector expressions of SQL translations for dplyr
http://db.rstudio.com/translation
Other
11 stars 5 forks source link

Fix `arrange` test issues #16

Open colearendt opened 6 years ago

colearendt commented 6 years ago

Relates to #8

When testing arrange, the default behavior is to pull the last column of the data.frame in question (since arrange does not modify columns like a mutate would). This can have problems with testing since the level of uniqueness of the sort is important to test success / failure.

Further, there can be problems with adding mutate() to create the column so the same level of uniqueness is present because

  1. it is not a unit test of arrange
  2. some verbs (like desc(column)) are not valid within mutate

Very tricky... it almost seems we need a "unique value" column like id or something... and then every arrange needs to be done by the computation in question and then by the unique column.