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

Shift layers don't throw intuitive errors when trying to use distinct counts #78

Open
mstackhouse opened this issue Jul 19, 2022 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@mstackhouse
Copy link
Contributor

Prerequisites

For more information, see the CONTRIBUTING guide.

Description

Shift layer errors

Steps to Reproduce (Bug Report Only)

library(Tplyr)

tplyr_table(mtcars, carb) %>% 
  add_layer(
    group_shift(vars(column=vs, row=am)) %>% 
      set_distinct_by(cyl) %>% 
      set_format_strings(
        f_str('xx | xx | xx.x% || xx | xx | xx.x%', n, total, pct, distinct_n, distinct_total, distinct_pct)
      )
  ) %>% 
  build()
#> Error in `mutate()`:
#> ! Problem while computing `n = construct_shift_string(...)`.
#> ℹ The error occurred in group 1: carb = "1".
#> Caused by error in `if (nchar(x)[1] < left_pad) ...`:
#> ! missing value where TRUE/FALSE needed

Created on 2022-07-19 by the reprex package (v0.3.0)

Expected behavior: [What you expected to happen]

A graceful error indicating that distinct counts aren't supported for shift layers

Actual behavior: [What actually happened]

Error message from failing internals

Versions

This is using current devel branch

@mstackhouse mstackhouse added the bug Something isn't working label Jul 19, 2022
@mstackhouse mstackhouse added the good first issue Good for newcomers label Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant