-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
inner_join incorrectly throws error #6835
Comments
Minimal reprex library(vctrs)
a <- data_frame(x = 1, y = 5, z = 3)
b <- data_frame(x = c(1, 2), y = c(4, 3), z = c(1, 2))
vec_locate_matches(
a,
b,
condition = c("<=", ">=", ">="),
filter = c("none", "none", "max"),
relationship = "none"
)
#> needles haystack
#> 1 1 2
vec_locate_matches(
a,
b,
condition = c("<=", ">=", ">="),
filter = c("none", "none", "max"),
relationship = "one-to-one"
)
#> Error in `vec_locate_matches()`:
#> ! Each value of `needles` can match at most 1 value from `haystack`.
#> ✖ Location 1 of `needles` matches multiple values.
#> Backtrace:
#> ▆
#> 1. ├─vctrs::vec_locate_matches(...)
#> 2. └─vctrs:::stop_matches_relationship_one_to_one(...) at vctrs/R/match.R:320:2
#> 3. └─vctrs:::stop_matches_relationship(...) at vctrs/R/match.R:491:2
#> 4. └─vctrs:::stop_matches(...) at vctrs/R/match.R:563:2
#> 5. └─vctrs:::stop_vctrs(...) at vctrs/R/match.R:360:2
#> 6. └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call) at vctrs/R/conditions.R:64:2 Notably this doesn't error, so it has something to do with nested containment groups because a <- data_frame(x = 1, y = 5, z = 3)
b <- data_frame(x = c(1, 2), y = c(3, 4), z = c(1, 2))
vec_locate_matches(
a,
b,
condition = c("<=", ">=", ">="),
filter = c("none", "none", "max"),
relationship = "one-to-one"
)
#> needles haystack
#> 1 1 2 |
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this issue
Jun 17, 2023
# vctrs 0.6.3 * Fixed an issue where certain ALTREP row names were being materialized when passed to `new_data_frame()`. We've fixed this by removing a safeguard in `new_data_frame()` that performed a compatibility check when both `n` and `row.names` were provided. Because this is a low level function designed for performance, it is up to the caller to ensure these inputs are compatible (tidyverse/dplyr#6596). * Fixed an issue where `vec_set_*()` used with data frames could accidentally return an object with the type of the proxy rather than the type of the original inputs (#1837). * Fixed a rare `vec_locate_matches()` bug that could occur when using a max/min `filter` (tidyverse/dplyr#6835).
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using inequality joins and setting relationship to "one-to-one", an error is thrown despite the criteria for a "one-to-one" match being satisfied.
Created on 2023-04-26 with reprex v2.0.2
The text was updated successfully, but these errors were encountered: