Skip to content
Open
Show file tree
Hide file tree
Changes from 12 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 35 additions & 1 deletion graphdatascience/arrow_client/v2/mutation_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,41 @@ class MutationClient:

@staticmethod
def mutate_node_property(client: AuthenticatedArrowClient, job_id: str, mutate_property: str) -> MutateResult:
mutate_config = {"jobId": job_id, "mutateProperty": mutate_property}
return MutationClient._mutate(
client=client,
job_id=job_id,
mutate_property=mutate_property,
)

@staticmethod
def mutate_relationship_property(
client: AuthenticatedArrowClient,
job_id: str,
mutate_relationship_type: str,
mutate_property: str | None,
) -> MutateResult:
return MutationClient._mutate(
client=client,
job_id=job_id,
mutate_property=mutate_property,
mutate_relationship_type=mutate_relationship_type,
)

@staticmethod
def _mutate(
client: AuthenticatedArrowClient,
job_id: str,
mutate_property: str | None = None,
mutate_relationship_type: str | None = None,
) -> MutateResult:
mutate_config = {
"jobId": job_id,
}
if mutate_relationship_type:
mutate_config["mutateRelationshipType"] = mutate_relationship_type
if mutate_property:
mutate_config["mutateProperty"] = mutate_property

start_time = time.time()
mutate_arrow_res = client.do_action_with_retry(MutationClient.MUTATE_ENDPOINT, mutate_config)
mutate_millis = math.ceil((time.time() - start_time) * 1000)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,6 @@ def write(
triangle_count_property: str | None = None,
username: str | None = None,
write_concurrency: int | None = None,
write_to_result_store: bool | None = None,
) -> "LocalClusteringCoefficientWriteResult":
"""
Executes the LocalClusteringCoefficient algorithm and writes results to the database.
Expand Down Expand Up @@ -195,8 +194,6 @@ def write(
Username for authentication
write_concurrency : int | None, default=None
Concurrency for writing back to the database
write_to_result_store : bool | None, default=None
Whether to write to the result store

Returns
-------
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,6 @@ def write(
tolerance: float | None = None,
username: str | None = None,
write_concurrency: int | None = None,
write_to_result_store: bool | None = None,
) -> ModularityOptimizationWriteResult:
"""
Executes the Modularity Optimization algorithm and writes the results back to the database.
Expand Down Expand Up @@ -259,8 +258,6 @@ def write(
Username for authentication
write_concurrency : int | None, default=None
The number of concurrent threads for writing
write_to_result_store : bool | None, default=None
Whether to write results to the result store

Returns
-------
Expand Down
Empty file.
Loading