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

Is using vec_is() in check_valid_cols() too strict? #657

Closed
DavisVaughan opened this issue Sep 30, 2019 · 4 comments
Closed

Is using vec_is() in check_valid_cols() too strict? #657

DavisVaughan opened this issue Sep 30, 2019 · 4 comments
Labels
vctrs ↗️ Requires vctrs package
Milestone

Comments

@DavisVaughan
Copy link
Member

Immediately breaks bench. I faintly remember we mentioned bench using expressions where it didn't have to?

packageVersion("tibble")
#> [1] '2.99.99.9006'

bench::mark(x = 1)
#> All columns in a tibble must be 1d or 2d objects:
#> * Column `expression` is bench_expr

rlang::last_trace()
#>  36. └─bench::mark(x = 1)
#>  37.   ├─base::summary(...) /Users/davis/Desktop/r/packages/bench/R/mark.R:120:2
#>  38.   ├─bench:::bench_mark(tibble::as_tibble(results, validate = FALSE)) /Users/davis/Desktop/r/packages/bench/R/mark.R:120:2
#>  39.   │ └─base::unique(c("bench_mark", class(x))) /Users/davis/Desktop/r/packages/bench/R/mark.R:124:2
#>  40.   ├─tibble::as_tibble(results, validate = FALSE) /Users/davis/Desktop/r/packages/bench/R/mark.R:120:2
#>  41.   └─tibble:::as_tibble.list(results, validate = FALSE)
#>  42.     └─tibble:::lst_to_tibble(x, .rows, .name_repair, col_lengths(x))
#>  43.       └─tibble:::check_valid_cols(x)

Created on 2019-09-30 by the reprex package (v0.2.1)

@krlmlr
Copy link
Member

krlmlr commented Oct 1, 2019

I took a stab at tweaking vctrs so that this eventually becomes a non-issue.

@krlmlr
Copy link
Member

krlmlr commented Oct 1, 2019

It's not that simple to fix in vctrs.

Options, in order of my preference:

  1. Fix in vctrs
  2. Cast to a list or a list_of when inserting into a tibble
  3. Declare this as a breaking change

I think the second option wouldn't be too much of an effort to implement. We still can strive for the first option.

CC @lionel-.

@lionel-
Copy link
Member

lionel- commented Oct 1, 2019

Option 2 would also be a breaking change, but if it doesn't break bench it'd be a reasonable workaround until we figure this out in vctrs.

@krlmlr krlmlr added the vctrs ↗️ Requires vctrs package label Oct 27, 2019
@krlmlr krlmlr closed this as completed in cc2e602 Nov 1, 2019
@krlmlr krlmlr added this to the 3.0.0 milestone Mar 21, 2020
@github-actions
Copy link
Contributor

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue and link to this old issue if necessary.

@github-actions github-actions bot locked and limited conversation to collaborators Mar 23, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
vctrs ↗️ Requires vctrs package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants