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

Unable to pass NULL as target value #1299

Closed
3 tasks done
odaniel1 opened this issue Jul 22, 2020 · 2 comments
Closed
3 tasks done

Unable to pass NULL as target value #1299

odaniel1 opened this issue Jul 22, 2020 · 2 comments
Assignees

Comments

@odaniel1
Copy link

odaniel1 commented Jul 22, 2020

Prework

  • Read and abide by drake's code of conduct.
  • Search for duplicates among the existing issues, both open and closed.
  • [] I am reasonably sure this is a genuine bug in drake and most likely not a user error. (If you run into an error and do not know the cause, please submit a "Trouble" issue instead.)
  • Be considerate of the maintainer's time and make it as easy as possible to troubleshoot any problems you identify. Read here and here to learn about minimal reproducible examples. Format your code according to the tidyverse style guide to make it easier for others to read.

Description

Passing NULL directly to drake as a target value returns a safe_deparse error.

Reproducible example

library(drake)
plan <- drake_plan(a = NULL)
make(plan)
#> Error in safe_deparse(x, backtick = TRUE): argument "x" is missing, with no default

Expected result

drake can handle NULL when returned as a value from a function; I had anticipated the same behaviour as the below:

library(drake)
f <- function(){return(NULL)}
plan <- drake_plan(a = f())
make(plan)
#> ▶ target a

Session info

#> ─ Session info ───────────────────────────────────────────────────────────────
#>  setting  value                       
#>  version  R version 3.6.3 (2020-02-29)
#>  os       Ubuntu 18.04.4 LTS          
#>  system   x86_64, linux-gnu           
#>  ui       X11                         
#>  language en_GB:en                    
#>  collate  en_GB.UTF-8                 
#>  ctype    en_GB.UTF-8              
#>  date     2020-07-22 
@odaniel1
Copy link
Author

I tried to re-tag as trouble but can't edit the label myself (I don't think!). Likely should be tagged as that instead - sorry!

@wlandau
Copy link
Member

wlandau commented Jul 22, 2020

Thanks, should be fixed now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants