-
Notifications
You must be signed in to change notification settings - Fork 16
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
Inconsistent detection of the magrittr dot (.) as an NSE variable #26
Comments
So filter has different semantics whether you are hitting the Bioconductor or dplyr version. The way that CodeDepends currently works (which is not quite perfectly correct but would cover the case here, I suspect) is that if dplyr is loaded previously in the script CodeDepends is aware of, it handles arguments to filter the way you would want for dplyr::filter. If not, it treats the filter call normally. i.e.,
You're probably right that more generally across everything we might want How is the code getting into CodeDepends? Is drake tracking which libraries are loaded somehow, or does it have a full script to operate on rather than only individual expressions (even beyond this, just in general CodeDepends is going to behave better and be more powerful/correct when operating on the whole script). |
Contrary to the established traditions of |
It has nothing to do with what is actually loaded in the session. Though
for the record the correct analysis ofa filter call actually does
technically sependnon what version of filter it will actually hit when run,
ie what packages are loaded
We do not look at that, but use a heuristic that depends on having the full
script available to guess at which version of filter it should assume is
being hit. This is not a limitation of codedepends but od statically
analyzing a dynamic language. Its not immediately clear how we could do
mich better rhat we are doing now without incorporating runtime analysis.
I'll look at this more closely tomorrow and will respond further then as
warrented.
…On Mar 13, 2018 6:59 PM, "Will Landau" ***@***.***> wrote:
Contrary to the established traditions of Make-like tools, drake focuses
on the user's R session, not script files. It analyzes the commands in the workflow
plan data frame
<https://ropensci.github.io/drake/articles/example-basic.html#the-workflow-plan-data-frame>
and the "imported" functions loaded in your R session (or a custom
environment you provide). If CodeDepends behaves differently depending on
which packages are loaded, targets could be invalidated in unpredictable
ways, which does not bode well for drake.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#26 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AA3dseFvll9Vr6Phq6Jmwvmczogz009wks5teHlggaJpZM4SpXbE>
.
|
From ropensci/drake#320:
The text was updated successfully, but these errors were encountered: