Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Minor specification fixes #344

Merged
merged 3 commits into from
Dec 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/spec-arrow-append-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ spec_arrow_append_table_arrow <- list(
arrow_append_table_arrow_error = function(con, table_name) {
#' An error is also raised
test_in <- stream_frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbAppendTableArrow(con, NA, test_in))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbAppendTableArrow(con, c("test", "test"), test_in))
},

Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-create-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ spec_arrow_create_table_arrow <- list(
arrow_create_table_arrow_error = function(ctx, con, table_name) {
#' An error is also raised
test_in <- stream_frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbCreateTableArrow(con, NA, test_in))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbCreateTableArrow(con, c(table_name, table_name), test_in))

#' Invalid values for the `temporary` argument
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-fetch-arrow-chunk.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec_arrow_fetch_arrow_chunk <- list(

arrow_fetch_arrow_chunk_atomic = function(con) {
#' @return
#' `dbFetchArrowChunk()` always returns an object coercible to a [data.frame]
#' with as many rows as records were fetched and as many
#' `dbFetchArrowChunk()` always returns an object coercible to a [data.frame] with
#' as many rows as records were fetched and as many
#' columns as fields in the result set,
#' even if the result is a single value
query <- trivial_query()
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-fetch-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec_arrow_fetch_arrow <- list(

arrow_fetch_arrow_atomic = function(con) {
#' @return
#' `dbFetchArrow()` always returns an object coercible to a [data.frame]
#' with as many rows as records were fetched and as many
#' `dbFetchArrow()` always returns an object coercible to a [data.frame] with
#' as many rows as records were fetched and as many
#' columns as fields in the result set,
#' even if the result is a single value
query <- trivial_query()
Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-get-query-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec_arrow_get_query_arrow <- list(

arrow_get_query_arrow_atomic = function(con) {
#' @return
#' `dbGetQueryArrow()` always returns an object coercible to a [data.frame]
#' with as many rows as records were fetched and as many
#' `dbGetQueryArrow()` always returns an object coercible to a [data.frame], with
#' as many rows as records were fetched and as many
#' columns as fields in the result set,
#' even if the result is a single value
query <- trivial_query()
Expand Down
12 changes: 6 additions & 6 deletions R/spec-arrow-read-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ spec_arrow_read_table_arrow <- list(
skip_if_not_dbitest(ctx, "1.7.99.2")

#' @return
#' `dbReadTableArrow()` returns a data frame that contains the complete data
#' from the remote table, effectively the result of calling [dbGetQueryArrow()]
#' with `SELECT * FROM <name>`.
#' `dbReadTableArrow()` returns an Arrow object that contains the complete data
#' from the remote table, effectively the result of calling [dbGetQueryArrow()] with
#' `SELECT * FROM <name>`.
penguins_in <- get_penguins(ctx)
dbWriteTable(con, table_name, penguins_in)
penguins_out <- check_arrow(dbReadTableArrow(con, table_name))
Expand All @@ -35,7 +35,7 @@ spec_arrow_read_table_arrow <- list(
skip("Causes segfault in adbc and duckdb")

#' @return
#' An empty table is returned as a data frame with zero rows.
#' An empty table is returned as an Arrow object with zero rows.
penguins_in <- get_penguins(ctx)[integer(), ]
dbWriteTable(con, table_name, penguins_in)
penguins_out <- check_arrow(dbReadTableArrow(con, table_name))
Expand Down Expand Up @@ -63,9 +63,9 @@ spec_arrow_read_table_arrow <- list(
arrow_read_table_arrow_error = function(ctx, con, table_name) {
#' An error is raised
dbWriteTable(con, table_name, data.frame(a = 1.5))
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbReadTableArrow(con, NA))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbReadTableArrow(con, c(table_name, table_name)))
},

Expand Down
4 changes: 2 additions & 2 deletions R/spec-arrow-write-table-arrow.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,9 @@ spec_arrow_write_table_arrow <- list(

#' An error is also raised
test_in <- stream_frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbWriteTableArrow(con, NA, test_in %>% stream_frame()))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbWriteTableArrow(con, c(table_name, table_name), test_in %>% stream_frame()))

#' Invalid values for the additional arguments
Expand Down
3 changes: 1 addition & 2 deletions R/spec-driver-constructor.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ spec_driver_constructor <- list(
constructor = function(ctx) {
pkg_name <- package_name(ctx)

#' The backend must support creation of an instance of its [DBIDriver-class]
#' subclass
#' The backend must support creation of an instance of its [DBIDriver-class] subclass
#' with a \dfn{constructor function}.
#' By default, its name is the package name without the leading \sQuote{R}
#' (if it exists), e.g., `SQLite` for the \pkg{RSQLite} package.
Expand Down
4 changes: 2 additions & 2 deletions R/spec-driver-data-type.R
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ test_data_type <- function(ctx, dbObj) {
}
)

#' The SQL data type for [factor]
#' The SQL data type for [factor] and
expect_identical(
dbDataType(dbObj, letters),
dbDataType(dbObj, factor(letters))
)
#' and [ordered] is the same as for character.
#' [ordered] is the same as for character.
expect_identical(
dbDataType(dbObj, letters),
dbDataType(dbObj, ordered(letters))
Expand Down
4 changes: 2 additions & 2 deletions R/spec-meta-bind-expr.R
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec_meta_bind_expr <- function(
expect_false(bind_res$visible)
}

#' for queries issued by [dbSendQuery()] or [dbSendQueryArrow()]
#' for queries issued by [dbSendQuery()] or [dbSendQueryArrow()] and
test_select_bind_expr(
arrow = arrow,
bind = bind,
Expand All @@ -39,7 +39,7 @@ spec_meta_bind_expr <- function(
expect_false(bind_res$visible)
}

#' and also for data manipulation statements issued by
#' also for data manipulation statements issued by
#' [dbSendStatement()].
test_select_bind_expr(
arrow = arrow,
Expand Down
4 changes: 2 additions & 2 deletions R/spec-meta-get-statement.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec_meta_get_statement <- list(
#' @return
#' `dbGetStatement()` returns a string, the query used in
query <- trivial_query()
#' either [dbSendQuery()]
#' either [dbSendQuery()] or
res <- local_result(dbSendQuery(con, query))
s <- dbGetStatement(res)
expect_type(s, "character")
Expand All @@ -22,7 +22,7 @@ spec_meta_get_statement <- list(
#
get_statement_statement = function(con, table_name) {
query <- paste0("CREATE TABLE ", table_name, " (a integer)")
#' or [dbSendStatement()].
#' [dbSendStatement()].
res <- local_result(dbSendStatement(con, query))
s <- dbGetStatement(res)
expect_type(s, "character")
Expand Down
12 changes: 6 additions & 6 deletions R/spec-result-fetch.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec_result_fetch <- list(

fetch_atomic = function(con) {
#' @return
#' `dbFetch()` always returns a [data.frame]
#' with as many rows as records were fetched and as many
#' `dbFetch()` always returns a [data.frame] with
#' as many rows as records were fetched and as many
#' columns as fields in the result set,
#' even if the result is a single value
query <- trivial_query()
Expand Down Expand Up @@ -87,8 +87,8 @@ spec_result_fetch <- list(
fetch_no_return_value = function(con, table_name) {
#'
#' Calling `dbFetch()` on a result set from a data manipulation query
#' created by [dbSendStatement()]
#' can be fetched and return an empty data frame, with a warning.
#' created by [dbSendStatement()] can
#' be fetched and return an empty data frame, with a warning.
query <- paste0("CREATE TABLE ", table_name, " (a integer)")

res <- local_result(dbSendStatement(con, query))
Expand Down Expand Up @@ -124,11 +124,11 @@ spec_result_fetch <- list(
result <- trivial_df(25)

res <- local_result(dbSendQuery(con, query))
#' by passing a whole number ([integer]
#' by passing a whole number ([integer] or
rows <- check_df(dbFetch(res, 10L))
expect_identical(rows, unrowname(result[1:10, , drop = FALSE]))

#' or [numeric])
#' [numeric])
rows <- check_df(dbFetch(res, 10))
expect_identical(rows, unrowname(result[11:20, , drop = FALSE]))

Expand Down
4 changes: 2 additions & 2 deletions R/spec-result-get-query.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ spec_result_get_query <- list(

get_query_atomic = function(con) {
#' @return
#' `dbGetQuery()` always returns a [data.frame]
#' with as many rows as records were fetched and as many
#' `dbGetQuery()` always returns a [data.frame], with
#' as many rows as records were fetched and as many
#' columns as fields in the result set,
#' even if the result is a single value
query <- trivial_query()
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-append-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ spec_sql_append_table <- list(
append_table_error = function(con, table_name) {
#' An error is also raised
test_in <- data.frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbAppendTable(con, NA, test_in))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbAppendTable(con, c("test", "test"), test_in))

#' Invalid values for the `row.names` argument
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-create-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ spec_sql_create_table <- list(
create_table_error = function(ctx, con, table_name) {
#' An error is also raised
test_in <- data.frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbCreateTable(con, NA, test_in))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbCreateTable(con, c(table_name, table_name), test_in))

#' Invalid values for the `row.names` and `temporary` arguments
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-exists-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ spec_sql_exists_table <- list(
exists_table_error = function(con, table_name) {
#' An error is also raised
dbWriteTable(con, table_name, data.frame(a = 1L))
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbExistsTable(con, NA))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbExistsTable(con, c(table_name, table_name)))
},

Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-list-objects.R
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ spec_sql_list_objects <- list(
#' accessible from the prefix (if passed) or from the global namespace
#' (if prefix is omitted).

#' Tables added with [dbWriteTable()]
#' Tables added with [dbWriteTable()] are
penguins <- get_penguins(ctx)
dbWriteTable(con, table_name, penguins)

#' are part of the data frame.
#' part of the data frame.
objects <- dbListObjects(con)
quoted_tables <- vapply(objects$table, dbQuoteIdentifier, conn = con, character(1))
expect_true(dbQuoteIdentifier(con, table_name) %in% quoted_tables)
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-list-tables.R
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ spec_sql_list_tables <- list(
# TODO
#' in the database.

#' Tables added with [dbWriteTable()]
#' Tables added with [dbWriteTable()] are
penguins <- get_penguins(ctx)
dbWriteTable(con, table_name, penguins)

#' are part of the list.
#' part of the list.
tables <- dbListTables(con)
expect_true(table_name %in% tables)
},
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-read-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ spec_sql_read_table <- list(
read_table = function(ctx, con, table_name) {
#' @return
#' `dbReadTable()` returns a data frame that contains the complete data
#' from the remote table, effectively the result of calling [dbGetQuery()]
#' with `SELECT * FROM <name>`.
#' from the remote table, effectively the result of calling [dbGetQuery()] with
#' `SELECT * FROM <name>`.
penguins_in <- get_penguins(ctx)
dbWriteTable(con, table_name, penguins_in)
penguins_out <- check_df(dbReadTable(con, table_name))
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-remove-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ spec_sql_remove_table <- list(
remove_table_error = function(con, table_name) {
#' An error is also raised
dbWriteTable(con, table_name, data.frame(a = 1L))
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbRemoveTable(con, NA))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbRemoveTable(con, c(table_name, table_name)))
},

Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-unquote-identifier.R
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ spec_sql_unquote_identifier <- list(

#'
unquote_identifier_simple = function(con) {
#' Unquoting simple strings (consisting of only letters) wrapped with [SQL()]
#' and then quoting via [dbQuoteIdentifier()] gives the same result as just
#' Unquoting simple strings (consisting of only letters) wrapped with [SQL()] and
#' then quoting via [dbQuoteIdentifier()] gives the same result as just
#' quoting the string.
simple_in <- "simple"
simple_quoted <- dbQuoteIdentifier(con, simple_in)
Expand Down
4 changes: 2 additions & 2 deletions R/spec-sql-write-table.R
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,9 @@ spec_sql_write_table <- list(
write_table_error = function(ctx, con, table_name) {
#' An error is also raised
test_in <- data.frame(a = 1L)
#' if `name` cannot be processed with [dbQuoteIdentifier()]
#' if `name` cannot be processed with [dbQuoteIdentifier()] or
expect_error(dbWriteTable(con, NA, test_in))
#' or if this results in a non-scalar.
#' if this results in a non-scalar.
expect_error(dbWriteTable(con, c(table_name, table_name), test_in))

#' Invalid values for the additional arguments `row.names`,
Expand Down
4 changes: 2 additions & 2 deletions man/spec_arrow_append_table_arrow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/spec_arrow_create_table_arrow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/spec_arrow_fetch_arrow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/spec_arrow_fetch_arrow_chunk.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions man/spec_arrow_get_query_arrow.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading