impact-initiatives-hppu / humind

Calculate Usual Humanitarian Composite Indicators
https://impact-initiatives-hppu.github.io/humind/
Other
1 stars 1 forks source link

[Error] 8 1 | value_to_sl: add_dummy_from_set handles empty set #145

Open github-actions[bot] opened 1 week ago

github-actions[bot] commented 1 week ago

Context: 8 1 | value_to_sl Type: Error Description: add_dummy_from_set handles empty set Tested Function: 8 1 | value_to_sl Test File: 'test-add_dummy_from_set.R Failed at Line: 37

Details: <dplyr:::mutate_error/rlang_error/error/condition> Error in dplyr::mutate(df,:=("{dummy_name}", dplyr::case_when(is.na({ { col } }) ~ NA_real_, stringr::str_detect({ { col } }, pattern) ~ 1, !stringr::str_detect({ { col } }, pattern) ~ 0, .default = NA_real_))): ℹ In argument: dummy_empty = dplyr::case_when(...). Caused by error in dplyr::case_when(): ! Failed to evaluate the left-hand side of formula 2. Caused by error in stringr::str_detect(): ! pattern can't be the empty string (""). Backtrace: ▆

  1. ├─humind::add_dummy_from_set(df, text_col, "dummy_empty", c()) at test-add_dummy_from_set.R:37:3
  2. │ ├─dplyr::mutate(...)
  3. │ └─dplyr:::mutate.data.frame(...)
  4. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  5. │ ├─base::withCallingHandlers(...)
  6. │ └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
  7. │ └─mask$eval_all_mutate(quo)
  8. │ └─dplyr (local) eval()
  9. ├─dplyr::case_when(...)
    1. │ └─dplyr:::case_formula_evaluate(...)
    2. │ ├─base::withCallingHandlers(...)
    3. │ └─rlang::eval_tidy(pair$lhs, env = default_env)
    4. ├─stringr::str_detect(text_col, pattern)
    5. │ └─stringr:::no_empty()
    6. │ └─cli::cli_abort(...)
    7. │ └─rlang::abort(...)
    8. │ └─rlang:::signal_abort(cnd, .file)
    9. │ └─base::signalCondition(cnd)
    10. ├─dplyr (local) <fn>(<rlng_rrr>)
    11. │ └─rlang::abort(message, parent = cnd, call = error_call)
    12. │ └─rlang:::signal_abort(cnd, .file)
    13. │ └─base::signalCondition(cnd)
    14. └─dplyr (local) <fn>(<rlng_rrr>)
    15. └─rlang::abort(message, class = error_class, parent = parent, call = error_call)
github-actions[bot] commented 5 days ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 3 days ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 3 days ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 3 days ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 15 hours ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 13 hours ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127

github-actions[bot] commented 10 hours ago

Related open issues for the same function:

321

320

319

318

317

166

165

164

163

162

161

160

159

158

157

156

155

154

153

152

151

150

149

148

147

146

144

143

142

141

140

139

138

137

136

135

134

133

132

131

130

129

128

127