Replacing missing values in DataFrames.jl with function requiring multiple inputs

The code below should create a new column in a DataFrame,

new_MaxAllwFAR = [15.0, 15.0, 15.0, 15.0].

Instead it creates,

new_MaxAllwFAR = [15.0, 15.0, missing, missing].

Can you help me understand why? And how should I debug in this instance? Is there a more efficient way to code this in DataFrames.jl?

using DataFrames

dataF = DataFrame(MaxAllwFAR = [15., 15., missing, missing], 
                  ComArea = [1000., 1000., 1000., 1000.], 
                  ResArea = [0., 0., 0., 0.], 
                  ResidFAR = [missing, missing, 10., 10.], 
                  CommFAR = [missing, missing, 15., 15.])

function xform_maxfar(max_far, com_area, res_area, resid_far, com_far)
    if ismissing(max_far)
        if com_area > res_area
            return com_far
        else
            return resid_far
        end
    else
        return max_far
    end
end

transform!(dataF, 
    [:MaxAllwFAR, :ComArea, :ResArea, :ResidFAR, :CommFAR] => 
    xform_maxfar => :new_MaxAllwFAR)

println(dataF)

The fix was to replace

with

transform!(dataF, 
    [:MaxAllwFAR, :ComArea, :ResArea, :ResidFAR, :CommFAR] => 
    ByRow(xform_maxfar) => :new_MaxAllwFAR)

The following ByCol version seems to be faster (5 up to 40 X), at least for the example case.

function newMax(max_far, com_area, res_area, resid_far, com_far)
        [ismissing(max_far[i]) ? 
        com_area[i] > res_area[i] ? 
        com_far[i] : 
        resid_far[i] : 
        max_far[i] 
        for i in eachindex(max_far)]
end

julia> @btime dataF.nM=newMax(eachcol(dataF[:,[:MaxAllwFAR, :ComArea, :ResArea, :ResidFAR, :CommFAR]])...)
  1.540 μs (32 allocations: 2.59 KiB)
4-element Vector{Float64}:
 15.0
 15.0
 15.0
 15.0

julia> @btime transform(dataF,
           [:MaxAllwFAR, :ComArea, :ResArea, :ResidFAR, :CommFAR] =>       
           newMax => :new_MaxAllwFAR);
  14.400 μs (175 allocations: 9.19 KiB)


julia> @btime transform(dataF,
                  [:MaxAllwFAR, :ComArea, :ResArea, :ResidFAR, :CommFAR] =>

                  ByRow(xform_maxfar) => :new_MaxAllwFAR);
  68.700 μs (490 allocations: 32.64 KiB)