Open RickMoynihan opened 9 years ago
The pretty print can be difficult to navigate on wide datasets so I've been using incanter.core/view
which brings up a spring gui with some spreadsheet affordances (notably it compresses column widths).
(defn view [dataset]
(incanter.core/view dataset)
dataset)
A debug macro sounds interesting, perhaps it should only take e.g. 5 rows though - otherwise the output would quickly become hard to read/ navigate. I wonder whether the label is surplus to requirements in this case - it might be sufficient to print the last line called.
@Robsteranium Don't see why we can't have both plain text and GUI versions; it's easy to do. I added the optional label in the example just in case the poor developer got lost, but "line called" is as good.
Simple pipe debug function
Perhaps this already exists and I've missed this in the codebase, but I really want to see what's going on in the pipeline. I'd imagine that some real-world pipelines would contain many more steps than the
convert-persons-data
example.I'd like to see the inclusion of some simple functions that help debug each step of the data tranformation. Clearly we have tools like
dotrace
at our disposal, but they don't know how to print Datasets. For example, I'd like to see something like this added to thegrafter.tabular
namespace:Would be used like any other pipeline function and deleted when debugging is over:
As you might expect, the REPL output displays intermediate Dataset stage:
This somewhat naïve implementation might be useful enough as is. Clearly this should only be used on a small sample of data because all that IO and side effects would be a terrible.
Maybe be some sort of threading debug macro e.g.
dbg->
would be more useful, because you could then simply rename the normal Thread First Macro in-place.