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

Naming pattern not used in dm_from_con() when keys are learned successfully #2213

Open
owenjonesuob opened this issue May 3, 2024 · 0 comments · May be fixed by #2214
Open

Naming pattern not used in dm_from_con() when keys are learned successfully #2213

owenjonesuob opened this issue May 3, 2024 · 0 comments · May be fixed by #2214

Comments

@owenjonesuob
Copy link
Contributor

A new .names parameter was added to dm_from_con() in v1.0.6 (#1790) - but it's currently ignored when learn_keys = TRUE and the subsequent key-querying is successful.

That's because dm_from_con() returns early if key-querying, via dm_learn_from_db(), succeeds.

Helpfully, dm_learn_from_db() already accepts a names_pattern argument, which is used to format the table names with {glue} in the same way as elsewhere - but we don't pass .names through to it in dm_from_con():

dm_learned <- dm_learn_from_db(con, ...)


For what it's worth, if key-querying fails, then later in dm_from_con() we do pass .names through to get_src_tbl_names():

src_tbl_names <- get_src_tbl_names(src, ..., names = .names)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

1 participant