@@ -38,10 +38,6 @@ DropUnits(cols::C...) where {C<:Column} = DropUnits(selector(cols))
3838
3939isrevertible (:: Type{<:DropUnits} ) = true
4040
41- _dropunit (x) = _dropunit (x, nonmissingtype (eltype (x)))
42- _dropunit (x, :: Type{Q} ) where {Q<: AbstractQuantity } = (map (ustrip, x), unit (Q))
43- _dropunit (x, :: Type ) = (x, NoUnits)
44-
4541function applyfeat (transform:: DropUnits , feat, prep)
4642 cols = Tables. columns (feat)
4743 names = Tables. columnnames (cols)
@@ -60,17 +56,14 @@ function applyfeat(transform::DropUnits, feat, prep)
6056 newfeat, (snames, units)
6157end
6258
63- _addunit (x, :: typeof (NoUnits)) = x
64- _addunit (x, u:: Units ) = map (v -> v * u, x)
65-
6659function revertfeat (:: DropUnits , newfeat, fcache)
6760 cols = Tables. columns (newfeat)
6861 names = Tables. columnnames (cols)
6962
7063 snames, units = fcache
7164 columns = map (names, units) do name, unit
7265 x = Tables. getcolumn (cols, name)
73- name ∈ snames ? _addunit (x, unit) : x
66+ name ∈ snames ? _withunit (x, unit) : x
7467 end
7568
7669 𝒯 = (; zip (names, columns)... )
0 commit comments