You can’t pass arbitrary expressions to macros like that, unfortunately.
DataFramesMeta.jl is not the tool for this. Rather, you should use the underlying DataFrames.jl system that DataFramesMeta.jl builds off of.
To do these kinds of expressions programmatically, make a vector of pairs
julia> df = DataFrame(x = rand(10), y = rand(10));
julia> t = [:x => ByRow(>(.5)), :y => ByRow(>(.6))]
2-element Vector{Pair{Symbol, ByRow{Base.Fix2{typeof(>), Float64}}}}:
:x => ByRow{Base.Fix2{typeof(>), Float64}}(Base.Fix2{typeof(>), Float64}(>, 0.5))
:y => ByRow{Base.Fix2{typeof(>), Float64}}(Base.Fix2{typeof(>), Float64}(>, 0.6))
julia> subset(df, t)
3×2 DataFrame
Row │ x y
│ Float64 Float64
─────┼────────────────────
1 │ 0.616501 0.70594
2 │ 0.716532 0.604494
3 │ 0.594781 0.930921
If you know what the operation is but not what the column name is, you can work with name programmatically.
julia> x_name = :x; y_name = :y;
julia> @rsubset(df, $x_name > .5, $y_name > .6)
3×2 DataFrame
Row │ x y
│ Float64 Float64
─────┼────────────────────
1 │ 0.616501 0.70594
2 │ 0.716532 0.604494
3 │ 0.594781 0.930921