Skip to content

Commit 83d2e0a

Browse files
committed
Fix reapply output
1 parent 4df9cf1 commit 83d2e0a

File tree

5 files changed

+8
-16
lines changed

5 files changed

+8
-16
lines changed

src/transforms.jl

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,10 +204,7 @@ function reapply(transform::Colwise, table, cache)
204204
vals = tcollect(colfunc(i) for i in 1:length(names))
205205

206206
# new table with transformed columns
207-
newtable = (; vals...) |> Tables.materializer(table)
208-
209-
# return new table and cache
210-
newtable, cache
207+
(; vals...) |> Tables.materializer(table)
211208
end
212209

213210
# ----------------

src/transforms/eigenanalysis.jl

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,7 @@ function reapply(transform::EigenAnalysis, table, cache)
111111

112112
# table with transformed columns
113113
𝒯 = (; zip(names, eachcol(Z))...)
114-
newtable = 𝒯 |> Tables.materializer(table)
115-
116-
newtable, cache
114+
𝒯 |> Tables.materializer(table)
117115
end
118116

119117
function eigenmatrices(transform, Y)

src/transforms/parallel.jl

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,12 @@ function reapply(p::Parallel, table, cache)
7878
caches = cache[2]
7979

8080
# reapply transforms in parallel
81-
f(t, c) = reapply(t, table, c) |> first
82-
itr = zip(p.transforms, caches)
83-
tables = tcollect(f(t, c) for (t, c) in itr)
81+
f(t, c) = reapply(t, table, c)
82+
itr = zip(p.transforms, caches)
83+
tables = tcollect(f(t, c) for (t, c) in itr)
8484

8585
# table with concatenated columns
86-
newtable = tablehcat(tables)
87-
88-
newtable, cache
86+
tablehcat(tables)
8987
end
9088

9189
function tablehcat(tables)

src/transforms/sequential.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ function reapply(s::Sequential, table, cache)
4242
for (ctransform, ccache) in zip(s.transforms, cache)
4343
current, _ = reapply(ctransform, current, ccache)
4444
end
45-
current, cache
45+
current
4646
end
4747

4848
"""

test/transforms.jl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,8 +411,7 @@
411411
t = Table(x=rand(1000))
412412
T = ZScore() Quantile()
413413
n1, c1 = apply(T, t)
414-
n2, c2 = reapply(T, t, c1)
414+
n2 = reapply(T, t, c1)
415415
@test n1 == n2
416-
@test c1 == c2
417416
end
418417
end

0 commit comments

Comments
 (0)