-
Notifications
You must be signed in to change notification settings - Fork 49
fix: pass naming pattern through to dm_learn_from_db() (#2213) #2214
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
base: main
Are you sure you want to change the base?
fix: pass naming pattern through to dm_learn_from_db() (#2213) #2214
Conversation
Current Aviator status
This pull request is currently open (not queued). How to mergeTo merge this PR, comment
See the real-time status of this PR on the
Aviator webapp.
Use the Aviator Chrome Extension
to see the status of your PR within GitHub.
|
14afa3c to
192226a
Compare
192226a to
a1119ed
Compare
There was a problem hiding this comment.
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 fixes an issue where the naming pattern was not being passed through to dm_learn_from_db(). The fix involves refactoring the "smart default" logic for naming patterns from get_src_tbl_names() to dm_from_con() and ensuring consistent use of names_pattern as the parameter name throughout the codebase.
Key changes:
- Moved smart default logic for naming patterns from
get_src_tbl_names()todm_from_con() - Standardized parameter name from
namestonames_patternacross functions - Updated
dm_learn_from_db()to use the correct column names with dot prefixes for glue templating
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| R/learn.R | Updated dm_learn_from_db() parameter name and column selection to use dot-prefixed names |
| R/dm_from_con.R | Added smart default logic for naming patterns and updated function calls to use names_pattern |
| R/db-helpers.R | Removed smart default logic and updated parameter name to names_pattern |
| tests/testthat/test-db-helpers.R | Updated test calls to use names_pattern parameter instead of names |
| #' } | ||
| #' @autoglobal | ||
| dm_learn_from_db <- function(dest, dbname = NA, schema = NULL, name_format = "{table}") { | ||
| dm_learn_from_db <- function(dest, dbname = NA, schema = NULL, names_pattern = "{.table}") { |
Copilot
AI
Aug 1, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The function documentation needs to be updated to reflect the parameter name change from name_format to names_pattern. The @param documentation likely still references the old parameter name.
|
@claude: Fix tests. |
|
@copilot: Fix tests. |
|
@owenjonesuob: Thank you for your patience. |
|
Claude encountered an error —— View job I'll analyze this and get back to you. |
Fixes #2213.
I had to move the "smart default" logic for
.namesup one level, fromget_src_tbl_names()intodm_from_con()- but I think that is a better place to keep it anyway, since that's where its behaviour is documented.I've also made sure
names_patternis used consistently as the "internal" name for this argument, wherever we see this "naming pattern" concept.