Prune Pipeline Leaf Nodes
Removes all leaf nodes — nodes that have no downstream dependents
(nothing depends on them). This is useful for cleaning up intermediate
pipelines after filter_node or difference
operations.
Pipeline): The pipeline to
prune.A new pipeline with leaf nodes removed.
p |> difference(p_remove) |> prune