`result` (`actual`) not identical to `keptRows` (`expected`).

`names(actual)`:   "id" "id_2"
`names(expected)`: "ID" "ID_2"

`actual$id` is a double vector (5, 7)
`expected$id` is absent

`actual$id_2` is a double vector (6, 8)
`expected$id_2` is absent

`actual$ID` is absent
`expected$ID` is a double vector (5, 7)

`actual$ID_2` is absent
`expected$ID_2` is a double vector (6, 8)

test_that("results utility functions work", {
data <- data.frame(databaseId = 1, foo = c(22))
columnName = c("databaseId", "charField", "dateField"),
dataType = c("bigint", "varchar", "date"),
data <- checkAndFixDataTypes(data, "foo", "foo.zip", junkSpec)
expect_warning(data <- checkAndFixDuplicateRows(data, "foo", "foo.zip", junkSpec))
test_that("formatChunk converts data types correctly", {
info = "Data frames should remain unchanged when types match."
test_that("formatChunk converts non-matching types to character", {
info = "Numeric columns in chunk should be converted to character."
# Test for error when types cannot be converted
test_that("formatChunk throws error for incompatible types", {
"id is of type numeric which cannot be converted between data frames pkValuesInDb and chunk"
test_that("format chunk handles int/numeric type conversions ok", {
test_that("Delete primary key rows function", {
DROP TABLE IF EXISTS @schema.@test_table;
CREATE TABLE @schema.@test_table (id int, id_2 int);
INSERT INTO @schema.@test_table (id, id_2) VALUES (1, 2);
INSERT INTO @schema.@test_table (id, id_2) VALUES (3, 4);
INSERT INTO @schema.@test_table (id, id_2) VALUES (5, 6);
INSERT INTO @schema.@test_table (id, id_2) VALUES (7, 8);
DatabaseConnector::renderTranslateExecuteSql(testDatabaseConnection, sql, schema = testSchema, test_table = testTable)
keyValues = data.frame(ID = c(1), ID_2 = (99)) # one key is valid, one is not
test_that("Delete primary key rows function SQLITE", {
sqliteConn <- DatabaseConnector::connect(dbms = "sqlite", server = ":memory:")
DatabaseConnector::renderTranslateExecuteSql(sqliteConn, sql, schema = "main", test_table = testTable)