Summary
I've noticed hints/suggestions/warnings in the drake
docs suggesting use of expose_imports
to ensure that changes in imported packages are tracked reproducibly, but the docs are relatively brief on the correct usage of this.
Example
I've now witnessed an example of the behaviour expose_imports
is designed to correct in my own usage of drake
, and I'd like to start using it.
In my case, the dependency that wasn't tracked was forcats
, which, in version 0.4.0
had a bug in fct_collapse
(Used by one of my functions) which would assign incorrect groups to the output factor.
0.4.0.9000
resolved this bug, and I updated to 0.4.0.9000
, some time ago, but did notice that targets that must have run against the old version were not invalidated.
Question
I'm guessing that this is a problem that expose_imports
might mitigate, but I don't really understand how / where to use it.
If I make scoped calls to my.package
in my drake
plans like so:
plan <- drake::drake_plan(
mtc = mtcars,
mtc_xformed = my.package::transfom_mtc(mtc)
)
And my.package::transform_mtc()
has some dependency on another package, (Eg. forcats
) then:
- where should I be calling
expose_imports
?- In the
prework
argument ofmake
? - In the top level of a file in
my.package/R/
?
- In the
- Should I be calling
expose_imports("my.package")
? orexpose_imports("forcats")
Some clarification of this would be awesome