Comments (2)
The following is an extended short example with three groups of rules, and a temporary workaround to help correct the bug:
library(pointblank)
c_agent <- create_agent( tbl= small_table) %>%
col_vals_regex(columns = vars(b, f),
#col_vals_regex(columns = vars(gnad_fin_url), # CORRECT
regex = "[a-z]",
step_id = "my_regex",
label = "This is my regex",
brief = "The current field must have at least one letter"
) %>%
col_vals_regex(columns = vars(b),
#col_vals_regex(columns = vars(gnad_fin_url), # CORRECT
regex = "\\d",
step_id = "anoter_regex_1_column",
label = "Another regex for just 1 column",
brief = "The b field must have at least one number"
) %>%
col_vals_regex(columns = vars(b, f),
#col_vals_regex(columns = vars(gnad_fin_url), # CORRECT
regex = "\\d",
step_id = "anoter_regex",
label = "Another regex",
brief = "The current field must have at least one number"
) %>%
interrogate()
c_agent # tooltip over "This is my regex" (first column in report table) is only visilbe for the first step of the series
c_agent$validation_set$step_id[1]
c_agent$validation_set$label[1]
c_agent$validation_set$brief[1] #!is.NA (this is correct)
c_agent$validation_set$step_id[2]
c_agent$validation_set$label[2]
c_agent$validation_set$brief[2] # is.NA (this is the bug)
get_agent_x_list(c_agent)$briefs # every second value is.NA for steps with several "sub-steps" (same bug)
c_agent$validation_set$brief # same bug
c_agent$validation_set$label # No NAs
# Start of the workaround
steps_labels_briefs <- data.frame(step_id = c_agent$validation_set$step_id, label=c_agent$validation_set$label, old_brief = c_agent$validation_set$brief, new_brief = NA)
steps_labels_briefs$step_group <-
sub(pattern = "^(.+)(\\.\\d{4})$", replacement ="\\1", steps_labels_briefs$step_id, perl = T)
# First row (step) of each group of steps
steps_labels_briefs_0001 <-
steps_labels_briefs[grepl(pattern = "^(.+)(\\.0001)$", steps_labels_briefs$step_id),]
# Assign the correct brief value (workaround)
steps_labels_briefs$new_brief <- steps_labels_briefs$old_brief
for (c_step_group in steps_labels_briefs_0001$step_group){
steps_labels_briefs$new_brief[steps_labels_briefs$step_group == c_step_group] <-
steps_labels_briefs_0001$old_brief[steps_labels_briefs_0001$step_group == c_step_group]
}
c_agent$validation_set$brief <- steps_labels_briefs$new_brief
# Check that the workaround worked
get_agent_x_list(c_agent)$briefs # correct
c_agent$validation_set$brief # correct (side note: much faster than previous line of code)
from pointblank.
Thanks for catching this. This can definitely be fixed!
from pointblank.
Related Issues (20)
- A possible switch to tidyeval for `values` and `left`/`right` arguments HOT 1
- Better handling for bad column selections HOT 3
- Support `where()` predicates for tidyselect in `info_columns()` HOT 2
- Cryptic performance bug with hashing HOT 2
- Validation steps sometimes do not align in the multiagent HOT 3
- Show labels in console output when using `interrogate()`
- col_exists shows no fail when column missing HOT 1
- `col_vals_equal()` doesn't match two `NA` values HOT 3
- `ggplot2::ggsave()` error with `pointblank::scan_data()` HOT 5
- Arithmetic overflow error converting expression to data type int.
- `quarto render --to html` makes some html tags visible in the validation report HOT 3
- Release pointblank 0.12.0 HOT 5
- Vignette for dynamic patterns in validation functions
- pointblank and tidyselect 1.2.1 HOT 1
- Conflicting validation report when using YAML in {targets} compared to interactive mode HOT 1
- Column names with spaces causes incorrect validation error HOT 1
- Release pointblank 0.12.1
- Bigquery with bigrquery . unable to find method for dbGetQuery
- Evaluation of datetimes not as expected HOT 3
- `value` is stripped of its class in comparison validation functions
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pointblank.