cugraph.Graph().from_dask_cudf_edgelist create NoneType

Viewed 34

I tried to create a Graph from a dask_cudf DataFrame, but the Graph get Nonetype without error Message

cluster = LocalCUDACluster()
client = Client(cluster)
Comms.comms.initialize(p2p=True)

edges = dask.read_csv('.csv')
edges = edges.groupby(['Source','Target'])['retweet_from'].count()
edges = edges.to_frame(name="weight").reset_index()
edges = edges.map_partitions(cudf.DataFrame.from_pandas)
G = cugraph.Graph().from_dask_cudf_edgelist(edges,
                                            source = 'Source',
                                            destination = 'Target',
                                            edge_attr = 'weight')

G.__class__
NoneType
1 Answers

Not all of the cuGraph functions can be pipelined.
The call from_dask_cudf_edgelist return None

The perferred way is:

G = cugraph.Graph()
G.from_dask_cudf_edgelist(edges,
                           source = 'Source',
                           destination = 'Target',
                           edge_attr = 'weight')

Then G.class will work

Related