Skip to content

Commit

Permalink
handle grouped data frames
Browse files Browse the repository at this point in the history
  • Loading branch information
pdeffebach committed Mar 29, 2024
1 parent f166cb2 commit 2e1692b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/macros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1555,6 +1555,8 @@ end
## transform & @transform
##
##############################################################################
copy_gd(x::GroupedDataFrame) = transform(x; ungroup = false)
copy_gd(x::AbstractDataFrame) = copy(x)
function generic_transform_select_helper(x, args...; wrap_byrow::Bool = false, modify::Bool = false, selectfun::Bool = false)
if selectfun
secondstagefun = select!
Expand Down Expand Up @@ -1586,7 +1588,7 @@ function generic_transform_select_helper(x, args...; wrap_byrow::Bool = false, m
end
else
quote
$z = $subset($copy($x), $w; view = true, skipmissing = true)
$z = $subset($copy_gd($x), $w; view = true, skipmissing = true)
$parent($secondstagefun($z, $(t...); $(kw...)))
end
end
Expand Down

0 comments on commit 2e1692b

Please sign in to comment.