|
1 | | -transformcol(t, s, col) = s in colnames(t) ? setcol(t, s, col) : pushcol(t, s, col) |
2 | | -function transformcol(t, col::NamedTuples.NamedTuple) |
3 | | - for (key, val) in zip(keys(col), values(col)) |
4 | | - t = transformcol(t, key, val) |
5 | | - end |
6 | | - t |
| 1 | +@deprecate transformcol setcol |
| 2 | + |
| 3 | +function _setcol(t, col::NamedTuples.NamedTuple) |
| 4 | + p = ((key => val) for (key, val) in zip(keys(col), values(col))) |
| 5 | + setcol(t, p) |
7 | 6 | end |
8 | | -transformcol(t, col::Union{Columns, IndexedTables.AbstractIndexedTable}) = transformcol(t, columns(col)) |
| 7 | +_setcol(t, col::Union{Columns, IndexedTables.AbstractIndexedTable}) = _setcol(t, columns(col)) |
| 8 | +_setcol(t, args...) = setcol(t, args...) |
9 | 9 |
|
10 | 10 | function transform_vec_helper(args...) |
11 | 11 | d = gensym() |
12 | | - func = Expr(:(->), d, Expr(:call, :(JuliaDBMeta.transformcol), d, with_helper(d, args[end]))) |
| 12 | + func = Expr(:(->), d, Expr(:call, :(JuliaDBMeta._setcol), d, with_helper(d, args[end]))) |
13 | 13 | Expr(:call, :(JuliaDBMeta._pipe), func, replace_keywords(args[1:end-1])...) |
14 | 14 | end |
15 | 15 |
|
@@ -42,8 +42,8 @@ macro transform_vec(args...) |
42 | 42 | end |
43 | 43 |
|
44 | 44 | function transform_helper(args...) |
45 | | - d = gensym() |
46 | | - func = Expr(:(->), d, Expr(:call, :(JuliaDBMeta.transformcol), d, map_helper(d, args[end]))) |
| 45 | + d = gensym() |
| 46 | + func = Expr(:(->), d, Expr(:call, :(JuliaDBMeta._setcol), d, map_helper(d, args[end]))) |
47 | 47 | Expr(:call, :(JuliaDBMeta._pipe_chunks), func, args[1:end-1]...) |
48 | 48 | end |
49 | 49 |
|
|
0 commit comments