You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To make sure that user-provided functions are evaluated in the user's namespace (and not in the package namespace), Tidier currently escapes functions individually using MacroTools.postwalk.
While this generally works well, I believe there are corner cases where this fails, such as when a compound function is embedded within an anonymous function.
(x -> mean•skipmissing(x))
If this is rewritten as a non-compound function, then it works fine.
A potential solution is to escape the entire expression as it is interpolated into eg transform() or other functions, as opposed to escaping functions individually.
Will leave this issue here as something to explore as this will likely fix this edge-case bug.
The text was updated successfully, but these errors were encountered:
The reason the entire expression can't be escaped easily is that the anonymous functions are then created in the user's namespace, which is not what we want.
Leaving this issue open because I do want to fix the specific example here. Can probably fix it another way when parsing the expression.
Another related issue is that when multiple anonymous functions are used within an across(), they both get the suffix _function, which causes an error since they produce the same column name.
To make sure that user-provided functions are evaluated in the user's namespace (and not in the package namespace), Tidier currently escapes functions individually using MacroTools.postwalk.
While this generally works well, I believe there are corner cases where this fails, such as when a compound function is embedded within an anonymous function.
(x -> mean•skipmissing(x))
If this is rewritten as a non-compound function, then it works fine.
A potential solution is to escape the entire expression as it is interpolated into eg
transform()
or other functions, as opposed to escaping functions individually.Will leave this issue here as something to explore as this will likely fix this edge-case bug.
The text was updated successfully, but these errors were encountered: