Is your feature request related to a problem? Please describe.
Typical cases of .collapse( are acting on a dict ({'type': 'account', 'risk': 'high'}) or a col list (cols=['type'] or cols=['type', 'risk']). Currently, a manual outer loop is required: for v in g._nodes[cols].drop_duplicates()... .
Describe the solution you'd like
g2 = g.collapse('root', match=['type', 'risk'])
g2 = g.collapse('root', match={'type': 'account', 'risk': 'high'})
It should also handle the case of the root id changing..
Describe alternatives you've considered
We can also support a general udf f(n1, n2), but until we get remote mode clearer, e.g., vectorization, wait
Additional context
It may make sense to wait until we've added collapse reductions and optimized those
Is your feature request related to a problem? Please describe.
Typical cases of
.collapse(are acting on a dict ({'type': 'account', 'risk': 'high'}) or a col list (cols=['type']orcols=['type', 'risk']). Currently, a manual outer loop is required:for v in g._nodes[cols].drop_duplicates()....Describe the solution you'd like
It should also handle the case of the root id changing..
Describe alternatives you've considered
We can also support a general udf
f(n1, n2), but until we get remote mode clearer, e.g., vectorization, waitAdditional context
It may make sense to wait until we've added collapse reductions and optimized those