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

add support for getproperty broadcasting #2655

Merged
merged 10 commits into from
Mar 25, 2021
9 changes: 9 additions & 0 deletions src/other/broadcasting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,15 @@ end
Base.dotview(df::SubDataFrame, ::typeof(!), idxs) =
throw(ArgumentError("broadcasting with ! row selector is not allowed for SubDataFrame"))


if isdefined(Base, :dotgetproperty)
Base.dotgetproperty(df::DataFrame, col::SymbolOrString) =
LazyNewColDataFrame(df, Symbol(col))
Base.dotgetproperty(df::SubDataFrame, col::SymbolOrString) =
throw(ArgumentError("broadcasting getproperty is not allowed for SubDataFrame since " *
"Julia 1.7. use `df[:, $col] .= ... instead"))
end

function Base.copyto!(lazydf::LazyNewColDataFrame, bc::Base.Broadcast.Broadcasted{T}) where T
if bc isa Base.Broadcast.Broadcasted{<:Base.Broadcast.AbstractArrayStyle{0}}
bc_tmp = Base.Broadcast.Broadcasted{T}(bc.f, bc.args, ())
Expand Down