Skip to content

Commit d5588b5

Browse files
committed
tests
1 parent 65b2a34 commit d5588b5

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

tests/testthat/test-run.R

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,29 @@ test_that("Runs work", {
279279
get_active_run_id()
280280
)
281281

282+
## Tests for SELECT API
283+
log_artifact(
284+
iris,
285+
write.csv,
286+
"iris.csv"
287+
)
288+
289+
result <- s3_select_from_artifact(
290+
"iris.csv",
291+
Expression = "SELECT \"Sepal.Length\" AS sl FROM s3object s WHERE CAST(\"Sepal.Length\" AS FLOAT) >= 5",
292+
InputSerialization = list(CSV = list(FileHeaderInfo = "USE", RecordDelimiter = "\n", FieldDelimiter = ","), CompressionType = "NONE")
293+
)
294+
295+
expect_equal(
296+
nrow(result),
297+
nrow(subset(iris, iris$Sepal.Length >= 5))
298+
)
299+
300+
expect_equal(
301+
ncol(result),
302+
1
303+
)
304+
282305
end_run()
283306
})
284307

0 commit comments

Comments
 (0)