Repository navigation
feat: Deprecate setting the row.names default via pkgconfig, and move pkgconfig to Suggests - #805
Conversation
…ve pkgconfig to Suggests
The `row.names` arguments of `dbFetch()`, `dbReadTable()`, `dbWriteTable()`, `sqlData()`, and `sqliteBuildTableDefinition()` now default to a plain `FALSE`.
A default set with `pkgconfig::set_config("RSQLite::row.names.query" = ...)` or `"RSQLite::row.names.table"` is still honored,
but only if pkgconfig is already loaded, and it warns once per session.
Pass `row.names` explicitly instead.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JK3J4sR7quzzvDCcL6ePB7
…names` default
`dbListTables()`, `dbExistsTable()`, and the schema lookup behind them fetched without `row.names`,
so a default set via `pkgconfig::set_config("RSQLite::row.names.query" = ...)` triggered the deprecation warning
even when every user-facing call passed `row.names` explicitly,
and a value of `TRUE` made them fail with "Column row_names not present in output".
They now pass `row.names = FALSE`.
The warning now says the setting may come from a package in use and that the `pkgconfig::set_config()` call should be removed.
New tests cover the per-package lookup and the internal queries.
The documented default for `row.names` in `sqliteBuildTableDefinition()` is corrected to `FALSE`.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01JK3J4sR7quzzvDCcL6ePB7
…e-retirement-s673v3
|
Review of this PR at a51ef38, by a Claude Code reviewer with clean context that read the PR description and the full diff against Low1. The tests use 2. One 3. The tests never exercise the two paths most users are on: a setting made from the global environment, and a session where pkgconfig is not loaded. Confirmed for the first half: under 4. "Once per session" is really once per distinct key and value, and the warning does not say which package made the setting. Confirmed. 5. The deprecation is not documented anywhere a user would look it up. By reading. The man pages now show a plain Checked and found sound
Generated by Claude Code |
The new row.names tests use `expect_no_warning()`, which was added in testthat 3.1.5. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
The warning was already emitted and memoised just before, so `expect_no_warning()` could not fail. Forgetting it first makes the expectation meaningful. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
The `row.names` parameter of `dbReadTable()` and `dbWriteTable()` now says that a default set with `pkgconfig::set_config()` is still honored with a deprecation warning. It also says that `row.names` should be passed explicitly. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Hr1rd3gjmufoKCWVDBPCgE
Accepted limitationsFindings 1, 2 and 5 of the review above are fixed in 950091b, 68a709a and b150b75. These two remain:
Generated by Claude Code |
RSQLite 2.0 changed the default of
row.namestoFALSE(#210) and offeredpkgconfig::set_config("RSQLite::row.names.query" = NA)(and"RSQLite::row.names.table") as a temporary, per-package way to restore the old default. This PR starts retiring that setting, and with it the hard dependency on pkgconfig.Changes
row.namesarguments ofdbFetch(),dbReadTable(),dbWriteTable(),sqlData(), andsqliteBuildTableDefinition()now default to a plainFALSE. The man pages show that instead of thepkgconfig::get_config(...)expression.row.namesis not passed, the new internalrow_names_default()(inR/pkgconfig.R, replacing thepkgconfig_dummy()stub) consults pkgconfig, but only if its namespace is already loaded. Anyone who calledpkgconfig::set_config()has it loaded, so nothing is loaded otherwise. The per-calling-package lookup works as before.pkgconfig::set_config()call and passrow.namesexplicitly. An explicitrow.namesargument always wins. Therow.namesdocumentation ofdbReadTable()anddbWriteTable()says the same.dbListTables(),dbExistsTable(), and the schema lookup behind them) now passrow.names = FALSE. Before, they read the setting too, so the deprecation warning fired even when all user-facing calls were explicit, and a value ofTRUEmade them fail with "Column row_names not present in output" (also onmain).row.namesinsqliteBuildTableDefinition()is corrected fromTRUEtoFALSE.tests/testthat/test-row-names-default.Rcover the plain default, the warn-and-honor path for both keys, the per-package lookup (a setting registered for another package applies only to calls from that package), and the internal queries. They useexpect_no_warning(), so the testthat requirement is now 3.1.5.Review
A clean-context review found no High or Medium issues; its Low findings are fixed or listed under Accepted limitations.
Follow-up
Removing the setting entirely after this is released is tracked in #803.
Checks
The new tests pass, and the new internal-query test fails without the fix. The full local test suite has errors only in
test-httpvfs.R("unable to open database file" when connecting to a local HTTP server) and in thecallrtest oftest-dbConnect.R(no installed RSQLite in the subprocess);origin/mainfails thetest-httpvfs.Rtests the same way in the same container, so they are unrelated to this change.🤖 Generated with Claude Code
https://claude.ai/code/session_01JK3J4sR7quzzvDCcL6ePB7