Conversation
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>
There was a problem hiding this comment.
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 replacecuratedCore::*usage. - Updated
curatedMetagenomicData()andreturnSamples()to use the new internal disconnect helper on exit. - Removed
curatedCorefrom package dependencies and updated related.githubdocumentation 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 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 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] |
| if (length(first_vals) == 1L) { | ||
| result <- dplyr::filter(view, | ||
| !!rlang::sym(first_col) == first_vals) |> | ||
| dplyr::collapse() |
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.