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

create_pb_agent() does not match any columns if level > 1 #2

Open
petrbouchal opened this issue Jan 13, 2021 · 1 comment
Open

create_pb_agent() does not match any columns if level > 1 #2

petrbouchal opened this issue Jan 13, 2021 · 1 comment

Comments

@petrbouchal
Copy link

petrbouchal commented Jan 13, 2021

Hi Emily,

Excellent idea. I took the package for a spin - mainly to see if it can live with the not-recommended scheme of having the measure in the second level.

That's how I found a minor bug in create_pb_agent(), where no checks are run by {pointblank} if level is set to 2 or more.

Reprex:

library(convo)
library(tibble)
library(pointblank)

dt <- tibble(car_id = numeric(), car_name = character(),
             passenger_cnt = numeric())

cnv <- structure(list(level1 = list(car = NULL, 
                                    passenger = NULL), 
                      level2 = list(id = list(valid = "col_is_numeric()"), 
                                    cnt = list(valid = "col_is_numeric()"), 
                                    name = NULL)), class = c("convo", "list"))

evaluate_convo(cnv, names(dt))
#> Level 1
#> - 
#> Level 2
#> -
cagent <- create_pb_agent(cnv, dt, level = 2)
cagent$validation_set
#> # A tibble: 0 x 29
#> # … with 29 variables: i <int>, step_id <chr>, sha1 <chr>,
#> #   assertion_type <chr>, column <list>, values <list>, na_pass <lgl>,
#> #   preconditions <list>, actions <list>, label <chr>, brief <chr>,
#> #   active <list>, eval_active <lgl>, eval_error <lgl>, eval_warning <lgl>,
#> #   capture_stack <list>, all_passed <lgl>, n <int>, n_passed <int>,
#> #   n_failed <int>, f_passed <dbl>, f_failed <dbl>, warn <lgl>, notify <lgl>,
#> #   stop <lgl>, row_sample <dbl>, tbl_checked <list>, time_processed <dttm>,
#> #   proc_duration_s <dbl>
# interrogate(cagent2) # shows no checks if run in an interactive session

Created on 2021-01-13 by the reprex package (v0.3.0)

Looking at the debug, I think it's caused by a bit of regex. I am aware this is experimental but in case it would be helpful I'd be happy to submit my local fix as a PR.

@emilyriederer
Copy link
Owner

Thank you so much for taking the time to check out the package and report this issue! Now that you say it, I realize my tests only do cover the level-1 checks and are probably too biased towards my own person workflow. I really appreciate your pointing this out.

If you wouldn't mind submitting your fix as a PR, that would be fantastic! Thanks again!

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

No branches or pull requests

2 participants