Skip to content

Refactor: inline curatedCore functions and fix ADR references#334

Open
lwaldron wants to merge 2 commits into
pr-325from
pr-330
Open

Refactor: inline curatedCore functions and fix ADR references#334
lwaldron wants to merge 2 commits into
pr-325from
pr-330

Conversation

@lwaldron

@lwaldron lwaldron commented Jul 3, 2026

Copy link
Copy Markdown
Member

This PR is against pr-325. It inlines curatedCore functions to remove external dependencies, fixes references to ADRs and .github, and applies code review suggestions.

lwaldron and others added 2 commits June 19, 2026 10:38
Inline the five curatedCore functions used by CMD (duckdbCatalogSource,
connectSource, closeSource, filterView, collectView) plus their
supporting validators directly into curatedMetagenomicData as internal
helpers. This eliminates the curatedCore package dependency entirely.

The multi-backend CuratedSource S4 class is replaced by a single
.cmd_connect() function since CMD only uses the duckdb_catalog backend.
The SchemaSpec parameter on filterView is dropped; CMD hardcodes its
id_col to sample_name via cmd4_data_types.csv.

Co-authored-by: Antigravity <gemini@google.com>
Copilot AI review requested due to automatic review settings July 3, 2026 14:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR removes the external curatedCore dependency by inlining the DuckDB connection/query helpers directly into curatedMetagenomicData, and updates internal documentation pointers (ADRs / .github references) to match the repository layout.

Changes:

  • Added internal DuckDB connection helpers (.cmd_connect(), .cmd_disconnect()) and query helpers (.filter_view(), .collect_view()) to replace curatedCore::* usage.
  • Updated curatedMetagenomicData() and returnSamples() to use the new internal disconnect helper on exit.
  • Removed curatedCore from package dependencies and updated related .github documentation and ignore rules.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
R/returnSamples.R Switches cleanup from curatedCore::closeSource() to internal .cmd_disconnect().
R/duckdb-query.R Adds inlined internal DuckDB view validation/projection/filter/collect helpers.
R/duckdb-connection.R Adds inlined internal DuckDB connection + httpfs/S3 configuration helpers.
R/curatedMetagenomicData.R Switches cleanup from curatedCore::closeSource() to internal .cmd_disconnect().
R/cmd4.R Removes embedded curatedCore-based connect/filter/collect wiring and points to new internal helpers.
DESCRIPTION Drops curatedCore (and its Remotes) and adds methods to Imports.
.Rbuildignore Removes a now-redundant ignore entry for .github/instructions.
.github/instructions/20-development.md Updates dependency documentation to remove curatedCore.
.github/adr/0000-record-architecture-decisions.md Fixes ADR path references to .github/adr/.

Comment thread R/duckdb-query.R
Comment on lines +38 to +42
if (!is.null(filter_values) &&
(!is.list(filter_values) || is.null(names(filter_values)))) {
stop("'filter_values' must be a named list of column = values",
call. = FALSE)
}
Comment thread R/duckdb-query.R
Comment on lines +82 to +89
if (view_name %in% matching) {
return(view_name)
}
id_views <- matching[grepl(id_col, matching)]
if (length(id_views) > 0L) {
return(id_views[1L])
}
matching[1L]
Comment thread R/duckdb-query.R
if (length(first_vals) == 1L) {
result <- dplyr::filter(view,
!!rlang::sym(first_col) == first_vals) |>
dplyr::collapse()
Comment thread R/duckdb-connection.R
Comment on lines +56 to +60
.configure_s3(con, db_url)
DBI::dbExecute(con, sprintf("ATTACH '%s' AS %s (READ_ONLY);",
db_url, alias))
DBI::dbExecute(con, sprintf("USE %s;", alias))
con
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants