Skip to content

Commit

Permalink
Extract join_ptype_common() (#7029)
Browse files Browse the repository at this point in the history
* Extract `join_ptype_common()`

* Move `vec_ptype_finalise()` into `join_ptype_common()`

---------

Co-authored-by: Davis Vaughan <[email protected]>
  • Loading branch information
krlmlr and DavisVaughan authored Jun 26, 2024
1 parent be36acf commit 0005f67
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/join-cols.R
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ add_suffixes <- function(x, y, suffix) {
}

join_cast_common <- function(x, y, vars, error_call = caller_env()) {
ptype <- join_ptype_common(x, y, vars, error_call = error_call)
vec_cast_common(x = x, y = y, .to = ptype, .call = error_call)
}

join_ptype_common <- function(x, y, vars, error_call = caller_env()) {
# Explicit `x/y_arg = ""` to avoid auto naming in `cnd$x_arg`
ptype <- try_fetch(
vec_ptype2(x, y, x_arg = "", y_arg = "", call = error_call),
Expand All @@ -192,7 +197,7 @@ join_cast_common <- function(x, y, vars, error_call = caller_env()) {
# Finalize unspecified columns (#6804)
ptype <- vec_ptype_finalise(ptype)

vec_cast_common(x = x, y = y, .to = ptype, .call = error_call)
ptype
}

rethrow_error_join_incompatible_type <- function(cnd, vars, call) {
Expand Down

0 comments on commit 0005f67

Please sign in to comment.