EPATADA icon indicating copy to clipboard operation
EPATADA copied to clipboard

TADA_FlagContinuousData and TADA_FindPotentialDuplicatsMultipleOrgs bugs: NAs showing up in flag columns

Open cristinamullin opened this issue 1 year ago • 2 comments

Describe the bug

See check failure here: https://github.com/USEPA/EPATADA/actions/runs/11579321148/job/32235236520?pr=536

To Reproduce

Review the test failure report below and find the data retrieval pull that was used for the test.


══ Warnings ════════════════════════════════════════════════════════════════════
── Warning ('test-ResultFlagsIndependent.R:92:3'): TADA_FindPotentialDuplicatsMultipleOrgs labels nearby site and multiple org groupings incrementally if duplicates are found ──
NAs introduced by coercion
Backtrace:
    ▆
 1. ├─... %>% sort() at test-ResultFlagsIndependent.R:92:3
 2. └─base::sort(.)

══ Failed tests ════════════════════════════════════════════════════════════════
── Error ('test-ResultFlagsIndependent.R:67:3'): No NA's in independent flag columns ──
<dplyr_error_join_incompatible_type/dplyr_error_join/dplyr_error/rlang_error/error/condition>
Error in `dplyr::full_join(., noncont.data, by = c(names(cont.data)))`: Can't join `x$TADA.ContinuousData.Flag` with `y$TADA.ContinuousData.Flag` due to incompatible types.
i `x$TADA.ContinuousData.Flag` is a <character>.
i `y$TADA.ContinuousData.Flag` is a <logical>.
Backtrace:
     ▆
  1. ├─EPATADA::TADA_FlagContinuousData(testdat, clean = FALSE, flaggedonly = FALSE) at test-ResultFlagsIndependent.R:67:3
  2. │ └─cont.data %>% ... at EPATADA/R/ResultFlagsIndependent.R:304:3
  3. ├─dplyr::full_join(., noncont.data, by = c(names(cont.data)))
  4. ├─dplyr:::full_join.data.frame(., noncont.data, by = c(names(cont.data)))
  5. │ └─dplyr:::join_mutate(...)
  6. │   └─dplyr:::join_cast_common(x_key, y_key, vars, error_call = error_call)
  7. │     ├─rlang::try_fetch(...)
  8. │     │ └─base::withCallingHandlers(...)
  9. │     └─vctrs::vec_ptype2(x, y, x_arg = "", y_arg = "", call = error_call)
 10. ├─vctrs (local) `<fn>`()
 11. │ └─vctrs::vec_default_ptype2(...)
 12. │   ├─base::withRestarts(...)
 13. │   │ └─base (local) withOneRestart(expr, restarts[[1L]])
 14. │   │   └─base (local) doWithOneRestart(return(expr), restart)
 15. │   └─vctrs::stop_incompatible_type(...)
 16. │     └─vctrs:::stop_incompatible(...)
 17. │       └─vctrs:::stop_vctrs(...)
 18. │         └─rlang::abort(message, class = c(class, "vctrs_error"), ..., call = call)
 19. │           └─rlang:::signal_abort(cnd, .file)
 20. │             └─base::signalCondition(cnd)
 21. └─rlang (local) `<fn>`(`<vctrs__2>`)
 22.   └─handlers[[1L]](cnd)
 23.     └─dplyr:::rethrow_error_join_incompatible_type(cnd, vars, error_call)
 24.       └─dplyr:::stop_join(...)
 25.         └─dplyr:::stop_dplyr(...)
 26.           └─rlang::abort(...)

[ FAIL 1 | WARN 1 | SKIP 0 | PASS 73 ]

cristinamullin avatar Oct 29 '24 19:10 cristinamullin

I can work on this one next, since I’m kind of on hold on the range check stuff until we can discuss at the WQX meeting.

hillarymarler avatar Oct 29 '24 19:10 hillarymarler

This appears to have been addressed in PR #560

hillarymarler avatar Jan 02 '25 19:01 hillarymarler