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

check_missing_currency fails if currencies is not on search path #45

Closed
AlexAxthelm opened this issue May 13, 2024 · 0 comments · Fixed by #46
Closed

check_missing_currency fails if currencies is not on search path #45

AlexAxthelm opened this issue May 13, 2024 · 0 comments · Fixed by #46

Comments

@AlexAxthelm
Copy link
Collaborator

!currency %in% currencies$currency ~ FALSE,

In this line, currencies object is referenced without definition or passing as argument to function.

Error in `mutate()`:
ℹ In argument: `has_currency = case_when(...)`.
Caused by error in `case_when()`:
! Failed to evaluate the left-hand side of formula 3.
Caused by error:
! object 'currencies' not found
Backtrace:
     ▆
  1. ├─workflow.pacta:::run_pacta()
  2. │ └─workflow.pacta:::run_audit(cfg_path)
  3. │   └─pacta.portfolio.audit::add_portfolio_flags(portfolio)
  4. │     └─pacta.portfolio.audit:::check_missing_currency(portfolio)
  5. │       └─portfolio_total %>% ...
  6. ├─dplyr::mutate(...)
  7. ├─dplyr:::mutate.data.frame(...)
  8. │ └─dplyr:::mutate_cols(.data, dplyr_quosures(...), by)
  9. │   ├─base::withCallingHandlers(...)
 10. │   └─dplyr:::mutate_col(dots[[i]], data, mask, new_columns)
 11. │     └─mask$eval_all_mutate(quo)
 12. │       └─dplyr (local) eval()
 13. ├─dplyr::case_when(...)
 14. │ └─dplyr:::case_formula_evaluate(...)
 15. │   ├─base::withCallingHandlers(...)
 16. │   └─rlang::eval_tidy(pair$lhs, env = default_env)
 17. ├─currency %in% currencies$currency
 18. └─base::.handleSimpleError(...)
 19.   └─dplyr (local) h(simpleError(msg, call))
 20.     └─rlang::abort(message, parent = cnd, call = error_call)
Execution halted
AlexAxthelm added a commit that referenced this issue May 16, 2024
Pass `currencies` object explicitly to `check_missing_currency()`

closes #45

---------

Co-authored-by: CJ Yetman <cj@cjyetman.com>
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

Successfully merging a pull request may close this issue.

1 participant