5
5
from ...call_parameters import CallParameters
6
6
from ...graph .graph_object import Graph
7
7
from ...query_runner .query_runner import QueryRunner
8
- from ..api .wcc_endpoints import WccEndpoints
8
+ from ..api .wcc_endpoints import WccEndpoints , WccMutateResult
9
9
10
10
11
11
class WccCypherEndpoints (WccEndpoints ):
@@ -32,7 +32,7 @@ def mutate(
32
32
seed_property : Optional [str ] = None ,
33
33
consecutive_ids : Optional [bool ] = None ,
34
34
relationship_weight_property : Optional [str ] = None ,
35
- ) -> Series [ Any ] :
35
+ ) -> WccMutateResult :
36
36
# Build configuration dictionary from parameters
37
37
config : dict [str , Any ] = {
38
38
"mutateProperty" : mutate_property ,
@@ -66,7 +66,17 @@ def mutate(
66
66
params = CallParameters (graph_name = G .name (), config = config )
67
67
params .ensure_job_id_in_config ()
68
68
69
- return self ._query_runner .call_procedure (endpoint = "gds.wcc.mutate" , params = params ).squeeze () # type: ignore
69
+ cypher_result = self ._query_runner .call_procedure (endpoint = "gds.wcc.mutate" , params = params ).squeeze ()
70
+
71
+ return WccMutateResult (
72
+ cypher_result ["componentCount" ],
73
+ cypher_result ["componentDistribution" ],
74
+ cypher_result ["preProcessingMillis" ],
75
+ cypher_result ["computeMillis" ],
76
+ cypher_result ["postProcessingMillis" ],
77
+ cypher_result ["mutateMillis" ],
78
+ cypher_result ["nodePropertiesWritten" ],
79
+ )
70
80
71
81
def stats (
72
82
self ,
@@ -82,7 +92,7 @@ def stats(
82
92
seed_property : Optional [str ] = None ,
83
93
consecutive_ids : Optional [bool ] = None ,
84
94
relationship_weight_property : Optional [str ] = None ,
85
- ) -> Series [ Any ] :
95
+ ) -> Series :
86
96
# Build configuration dictionary from parameters
87
97
config : dict [str , Any ] = {}
88
98
@@ -185,7 +195,7 @@ def write(
185
195
relationship_weight_property : Optional [str ] = None ,
186
196
write_concurrency : Optional [int ] = None ,
187
197
write_to_result_store : Optional [bool ] = None ,
188
- ) -> Series [ Any ] :
198
+ ) -> Series :
189
199
# Build configuration dictionary from parameters
190
200
config : dict [str , Any ] = {
191
201
"writeProperty" : write_property ,
0 commit comments