Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mrkaye97 committed Jul 8, 2022
1 parent 65b2a34 commit d5588b5
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/testthat/test-run.R
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,29 @@ test_that("Runs work", {
get_active_run_id()
)

## Tests for SELECT API
log_artifact(
iris,
write.csv,
"iris.csv"
)

result <- s3_select_from_artifact(
"iris.csv",
Expression = "SELECT \"Sepal.Length\" AS sl FROM s3object s WHERE CAST(\"Sepal.Length\" AS FLOAT) >= 5",
InputSerialization = list(CSV = list(FileHeaderInfo = "USE", RecordDelimiter = "\n", FieldDelimiter = ","), CompressionType = "NONE")
)

expect_equal(
nrow(result),
nrow(subset(iris, iris$Sepal.Length >= 5))
)

expect_equal(
ncol(result),
1
)

end_run()
})

Expand Down

0 comments on commit d5588b5

Please sign in to comment.