ThinkR-open / ThinkR-open/datadiff
[robustesse] Une colonne booléenne __ok/__eq absente passe silencieusement (all(NULL) == TRUE)
Nobody has claimed this yet.
- Dominant language
- R
- Stars
- 6
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
Contexte
Les accesseurs du fast path retournent NULL si la colonne booléenne n'existe pas, et les réducteurs concluent alors PASS :
tol_col_bool()/eq_col_bool()(R/fast_path.R) →tbl[["x__ok"]]=NULLsi absente ;tol_col_passes()→isTRUE(all(NULL))= TRUE ;tol_col_counts()(R/coverage.R) →n = 0, n_failed = 0→ ligne PASS avec n=0 dans la coverage.
Le scénario est rendu possible par le chemin lazy : la table slim est construite avec dplyr::select(dplyr::any_of(val_cols)) (R/compare_datasets_from_yaml.R, construction de cmp_slim), qui droppe silencieusement toute colonne manquante. Aujourd'hui les colonnes sont toujours produites en amont, mais aucun garde-fou ne protège contre une dérive future — et le mode de casse serait un faux « all pass », le pire possible pour un outil de non-régression. Constat convergent de deux analyses indépendantes (fast_path et coverage).
Reprex (interne)
tbl <- data.frame(a = 1:3) # aucune colonne a__ok
datadiff:::tol_col_passes(tbl, "a") # TRUE — devrait être une erreur
datadiff:::tol_col_counts(tbl, "a") # n = 0, n_failed = 0 → PASS silencieux
Critères de succès
-
tol_col_bool()/eq_col_bool()échouent avec un message explicite (« internal error: boolean column 'a__ok' missing ») si la colonne attendue est absente (poureq_col_boollocal, l'absence de la paire candidat/référence). - Le
select()de la table slim lazy utiliseall_of()(erreur franche) au lieu deany_of(). - Tests unitaires des deux accesseurs sur colonne manquante.
- Aucun impact perf mesurable sur le bench dev/bench (le check est O(1) par colonne).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with tol_col_bool() and eq_col_bool() in R/fast_path.R, then inspect tol_col_passes() and tol_col_counts() in R/coverage.R and the cmp_slim construction in R/compare_datasets_from_yaml.R. Run the unit tests for the two accessors and the dev/bench benchmark. Done means missing boolean columns fail explicitly, slim-table selection fails loudly, and no measurable benchmark regression is found.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r
- Domain
- data, testing-qa
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100