Closed phisanti closed 1 year ago
Thanks for the issue, I tried adding this to the test harness, and I am not reproducing this. A reprex::reprex(wd=".")
(after renaming the modules) looks like this:
set.seed(42)
import::from("module_issue_colonequals_1.R", foo1)
dt <- data.table::as.data.table(cars[1:3,])
foo1(dt)
print(dt)
#> speed dist newcol
#> 1: 4 2 1.3709584
#> 2: 4 10 -0.5646982
#> 3: 7 4 0.3631284
import::from("module_issue_colonequals_2.R", foo2)
foo2(dt$newcol)
#> [1] 2.3709584 0.4353018 1.3631284
Created on 2023-03-13 with reprex v2.0.2
So it looks like something else must be going on for you.
Yes, that is correct, but as soon as I start importing more functions, the import::from()
stops working. Have you tried including two or three more function imports in the example?
Yupp, tried running the example and then importing some additional functions, but I'm not seeing any issues. Not sure what is going on there.
If you can build on the reprex that I sent (copy code that reproduces the issue reliably, and then run reprex::reprex(wd=".")
then I can take a closer look. But I suspect this might have to do with some additional complexities in your setup.
I'll close this issue now since I am not able to reproduce this. If a reprex can be prepared to reliably reproduce this, we can open it again.
I am a huge fan of your package, however, I have just noticed it seems to be a bit problematic when dealing with some special objects of the
data.table
package, particularly, the:=
function. See this example:file_1.R
file_2.R
file 3
For some reason, after importing the functions that contain the function
:=
, it is impossible to load any other further function. In this particular case, if one loads firstfoo2
and thenfoo1
, it would be possible to have both functions, yet again, it won't be possible to add any other function viaimpot::