Hello,
This is more of a code style thing, but I often need to construct a Query.jl pipeline (|>
) that returns a single row, not a query result with multiple rows. Is there a neat way of doing this? Currently, I use collect
at the end of the pipeline, and then just return the first element of the array, which is ugly.
Here is an example of what I am talking about. I need to return a single NamedTuple
.
ret = load("myfile.csv") |>
@map({_.key, score=my_scoring_funk(_)}) |>
@orderby_descending(_.score) |>
@take(1) |>
collect # This is ugly
return ret[1] # This is ugly too