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

@filter will not interpolate column name #123

Closed
co1emi11er2 opened this issue Nov 5, 2024 · 2 comments
Closed

@filter will not interpolate column name #123

co1emi11er2 opened this issue Nov 5, 2024 · 2 comments

Comments

@co1emi11er2
Copy link

The following does not work:

t = :bar
s = "foo"
@chain df begin
    @filter(!!t == !!s)
end

This works though:

s = "foo"
@chain df begin
    @filter(bar == !!s)
end
@drizk1
Copy link
Member

drizk1 commented Nov 6, 2024

Although the documentation is not yet updated, TidierData is shifting to use the following method of interpolation that leverages @eval and $ as a more robust way that avoids challenging edge cases

Demarcate the variables with $ and start the chain with @eval

t = :bar
s = "foo"
@eval @chain df begin
    @filter($t == $s)
end

This should work already without needing to update the package.

@kdpsingh
Copy link
Member

We have documented the new preferred interpolation syntax here: https://tidierorg.github.io/TidierData.jl/latest/examples/generated/UserGuide/interpolation/

Closing this issue.

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

No branches or pull requests

3 participants