From 189253f2a5e297427762479f8e578c240aca11a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 15:29:23 +0100 Subject: [PATCH 1/9] Use typed concurrency and job_id instead of Any --- .../api/catalog/scale_properties_endpoints.py | 4 ++-- .../articulationpoints_endpoints.py | 18 ++++++++--------- .../api/centrality/betweenness_endpoints.py | 20 +++++++++---------- .../api/centrality/closeness_endpoints.py | 6 +++--- .../closeness_harmonic_endpoints.py | 18 ++++++++--------- .../api/centrality/degree_endpoints.py | 18 ++++++++--------- .../api/centrality/eigenvector_endpoints.py | 18 ++++++++--------- .../api/centrality/pagerank_endpoints.py | 18 ++++++++--------- .../api/community/hdbscan_endpoints.py | 8 ++++---- .../arrow/catalog_arrow_endpoints.py | 4 ++-- .../articulationpoints_arrow_endpoints.py | 2 +- .../centrality/betweenness_arrow_endpoints.py | 20 +++++++++---------- .../centrality/closeness_arrow_endpoints.py | 2 +- .../closeness_harmonic_arrow_endpoints.py | 2 +- .../centrality/degree_arrow_endpoints.py | 2 +- .../centrality/eigenvector_arrow_endpoints.py | 2 +- .../centrality/pagerank_arrow_endpoints.py | 2 +- .../clique_counting_arrow_endpoints.py | 2 +- .../community/hdbscan_arrow_endpoints.py | 10 +++++----- .../arrow/community/kmeans_arrow_endpoints.py | 2 +- .../arrow/community/leiden_arrow_endpoints.py | 2 +- .../articulationpoints_cypher_endpoints.py | 18 ++++++++--------- .../betweenness_cypher_endpoints.py | 20 +++++++++---------- .../centrality/closeness_cypher_endpoints.py | 18 ++++++++--------- .../closeness_harmonic_cypher_endpoints.py | 18 ++++++++--------- .../centrality/degree_cypher_endpoints.py | 18 ++++++++--------- .../eigenvector_cypher_endpoints.py | 18 ++++++++--------- .../centrality/pagerank_cypher_endpoints.py | 18 ++++++++--------- .../community/hdbscan_cypher_endpoints.py | 10 +++++----- .../knn_filtered_cypher_endpoints.py | 18 ++++++++--------- 30 files changed, 168 insertions(+), 168 deletions(-) diff --git a/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py b/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py index fe4bb544e..75fb35c42 100644 --- a/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py +++ b/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py @@ -24,8 +24,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ScalePropertiesMutateResult: """ Runs the Scale Properties algorithm and stores the results in the graph catalog as a new node property. diff --git a/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py b/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py index 9dd52a529..3e1ac4bb8 100644 --- a/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py @@ -22,8 +22,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ArticulationPointsMutateResult: """ Runs the Articulation Points algorithm and stores the results in the graph catalog as a new node property. @@ -66,8 +66,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ArticulationPointsStatsResult: """ Runs the Articulation Points algorithm and returns result statistics without storing the results. @@ -108,8 +108,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: """ Executes the ArticulationPoints algorithm and returns results as a stream. @@ -151,8 +151,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ArticulationPointsWriteResult: """ @@ -195,7 +195,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: """ Estimate the memory consumption of an algorithm run. diff --git a/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py b/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py index 62281c431..b49bdd49d 100644 --- a/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py @@ -24,8 +24,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessMutateResult: """ @@ -80,8 +80,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessStatsResult: """ @@ -134,8 +134,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DataFrame: """ @@ -184,10 +184,10 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, - write_concurrency: Any | None = None, + write_concurrency: int | None = None, ) -> BetweennessWriteResult: """ Runs the Betweenness Centrality algorithm and stores the result in the Neo4j database as a new node property. @@ -240,7 +240,7 @@ def estimate( sampling_seed: int | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: """ diff --git a/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py b/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py index 19eafbd49..0909c0761 100644 --- a/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py @@ -170,8 +170,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ClosenessWriteResult: """ @@ -221,7 +221,7 @@ def estimate( use_wasserman_faust: bool = False, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: """ Estimate the memory consumption of an algorithm run. diff --git a/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py b/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py index 764ea216a..b4c791f3e 100644 --- a/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py @@ -22,8 +22,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessHarmonicMutateResult: """ Runs the Harmonic Centrality algorithm and stores the results in the graph catalog as a new node property. @@ -69,8 +69,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessHarmonicStatsResult: """ Runs the Harmonic Centrality algorithm and returns result statistics without storing the results. @@ -116,8 +116,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: """ Executes the Harmonic Closeness Centrality algorithm and returns a stream of results. @@ -159,8 +159,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ClosenessHarmonicWriteResult: """ @@ -208,7 +208,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: """ Estimate the memory consumption of a Harmonic Closeness Centrality algorithm run. diff --git a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py index c75ece346..363941de9 100644 --- a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py @@ -23,8 +23,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DegreeMutateResult: """ @@ -77,8 +77,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DegreeStatsResult: """ @@ -129,8 +129,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DataFrame: """ @@ -184,8 +184,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, write_concurrency: int | None = None, ) -> DegreeWriteResult: @@ -238,7 +238,7 @@ def estimate( orientation: str = "NATURAL", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: """ diff --git a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py index 170db0cd5..ad547464b 100644 --- a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py @@ -28,8 +28,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> EigenvectorMutateResult: """ Runs the Eigenvector Centrality algorithm and stores the results in the graph catalog as a new node property. @@ -96,8 +96,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> EigenvectorStatsResult: """ Runs the Eigenvector Centrality algorithm and returns result statistics without storing the results. @@ -162,8 +162,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: """ Executes the Eigenvector Centrality algorithm and returns a stream of results. @@ -224,8 +224,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> EigenvectorWriteResult: """ @@ -292,7 +292,7 @@ def estimate( relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: """ Estimate the memory consumption of an algorithm run. diff --git a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py index 9f4db6459..cd6af3349 100644 --- a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py @@ -27,8 +27,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> PageRankMutateResult: @@ -95,8 +95,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> PageRankStatsResult: @@ -161,8 +161,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> DataFrame: @@ -225,8 +225,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, write_concurrency: int | None = None, @@ -293,7 +293,7 @@ def estimate( scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> EstimationResult: diff --git a/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py b/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py index ac8dd3c5e..8910d9618 100644 --- a/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py @@ -27,7 +27,7 @@ def mutate( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanMutateResult: """ @@ -85,7 +85,7 @@ def stats( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanStatsResult: """ @@ -141,7 +141,7 @@ def stream( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> DataFrame: """ @@ -198,7 +198,7 @@ def write( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, write_concurrency: int | None = None, ) -> HdbscanWriteResult: diff --git a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py index 007775f5f..1ca46bcf0 100644 --- a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py @@ -67,7 +67,7 @@ def project( query: str, *, job_id: str | None = None, - concurrency: int = 4, + concurrency: int | None = None, undirected_relationship_types: builtins.list[str] | None = None, inverse_indexed_relationship_types: builtins.list[str] | None = None, batch_size: int | None = None, @@ -85,7 +85,7 @@ def project( Must contain `gds.graph.project.remote`. Example: `MATCH (n)-->(m) RETURN gds.graph.project.remote(n, m)` job_id : str | None, default=None Unique identifier for the projection job. - concurrency : int, default=4 + concurrency : int | None Number of concurrent threads/processes to use during graph projection. undirected_relationship_types : list[str] List of relationship types to treat as undirected. diff --git a/graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py index e146e0094..4ee2229bd 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py @@ -143,7 +143,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: config = self._node_property_endpoints.create_estimate_config( relationship_types=relationship_types, diff --git a/graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py index bb5c64b93..2f1a946a8 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py @@ -40,8 +40,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessMutateResult: config = self._node_property_endpoints.create_base_config( @@ -72,8 +72,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessStatsResult: config = self._node_property_endpoints.create_base_config( @@ -104,8 +104,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DataFrame: config = self._node_property_endpoints.create_base_config( @@ -135,10 +135,10 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, - write_concurrency: Any | None = None, + write_concurrency: int | None = None, ) -> BetweennessWriteResult: config = self._node_property_endpoints.create_base_config( G, @@ -172,7 +172,7 @@ def estimate( sampling_seed: int | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: config = self._node_property_endpoints.create_estimate_config( diff --git a/graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py index 1d899bbd0..2a6d4d3af 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py @@ -155,7 +155,7 @@ def estimate( use_wasserman_faust: bool = False, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: algo_config = self._node_property_endpoints.create_estimate_config( use_wasserman_faust=use_wasserman_faust, diff --git a/graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py index 7408ce49b..6190159f5 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py @@ -144,7 +144,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: algo_config = self._node_property_endpoints.create_estimate_config( relationship_types=relationship_types, diff --git a/graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py index 1fba0509a..5c7526c9a 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py @@ -157,7 +157,7 @@ def estimate( orientation: str = "NATURAL", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: config = self._node_property_endpoints.create_estimate_config( diff --git a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py index 0af614100..8759363f0 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py @@ -195,7 +195,7 @@ def estimate( relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler algo_config = self._node_property_endpoints.create_estimate_config( diff --git a/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py index 765ca36ef..3964764fc 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py @@ -205,7 +205,7 @@ def estimate( scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> EstimationResult: diff --git a/graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py index d315f5ec6..451502a89 100644 --- a/graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py @@ -147,7 +147,7 @@ def write( def estimate( self, G: GraphV2 | dict[str, Any], - concurrency: Any | None = 4, + concurrency: int | None = None, node_labels: list[str] = ALL_LABELS, relationship_types: list[str] = ALL_TYPES, ) -> EstimationResult: diff --git a/graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py index 3ac123058..734290133 100644 --- a/graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py @@ -42,7 +42,7 @@ def mutate( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanMutateResult: config = self._node_property_endpoints.create_base_config( @@ -77,7 +77,7 @@ def stats( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanStatsResult: config = self._node_property_endpoints.create_base_config( @@ -112,7 +112,7 @@ def stream( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> DataFrame: config = self._node_property_endpoints.create_base_config( @@ -147,7 +147,7 @@ def write( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanWriteResult: config = self._node_property_endpoints.create_base_config( @@ -190,7 +190,7 @@ def estimate( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> EstimationResult: config = self._node_property_endpoints.create_estimate_config( diff --git a/graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py index 76d254648..208b5fa9d 100644 --- a/graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py @@ -182,7 +182,7 @@ def write( seed_centroids: list[list[float]] | None = None, sudo: bool = False, username: str | None = None, - write_concurrency: Any | None = None, + write_concurrency: int | None = None, ) -> KMeansWriteResult: config = self._node_property_endpoints.create_base_config( G, diff --git a/graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py index 4099cea1b..71dbd4e18 100644 --- a/graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py @@ -186,7 +186,7 @@ def write( theta: float = 0.01, tolerance: float = 0.0001, username: str | None = None, - write_concurrency: Any | None = None, + write_concurrency: int | None = None, ) -> LeidenWriteResult: config = self._node_property_endpoints.create_base_config( G, diff --git a/graphdatascience/procedure_surface/cypher/centrality/articulationpoints_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/articulationpoints_cypher_endpoints.py index 18fbd3df7..3af8d1d9f 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/articulationpoints_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/articulationpoints_cypher_endpoints.py @@ -32,8 +32,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ArticulationPointsMutateResult: config = ConfigConverter.convert_to_gds_config( mutate_property=mutate_property, @@ -64,8 +64,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ArticulationPointsStatsResult: config = ConfigConverter.convert_to_gds_config( concurrency=concurrency, @@ -95,8 +95,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( concurrency=concurrency, @@ -125,8 +125,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ArticulationPointsWriteResult: config = ConfigConverter.convert_to_gds_config( @@ -156,7 +156,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: # Build algorithm configuration mirroring other algorithms (see CELF implementation) algo_config = ConfigConverter.convert_to_gds_config( diff --git a/graphdatascience/procedure_surface/cypher/centrality/betweenness_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/betweenness_cypher_endpoints.py index b67ba829a..b66a886ca 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/betweenness_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/betweenness_cypher_endpoints.py @@ -37,8 +37,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessMutateResult: config = ConfigConverter.convert_to_gds_config( @@ -74,8 +74,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> BetweennessStatsResult: config = ConfigConverter.convert_to_gds_config( @@ -110,8 +110,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( @@ -143,10 +143,10 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, - write_concurrency: Any | None = None, + write_concurrency: int | None = None, ) -> BetweennessWriteResult: config = ConfigConverter.convert_to_gds_config( write_property=write_property, @@ -179,7 +179,7 @@ def estimate( sampling_seed: int | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: algo_config = ConfigConverter.convert_to_gds_config( diff --git a/graphdatascience/procedure_surface/cypher/centrality/closeness_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/closeness_cypher_endpoints.py index 06debd0f4..3bdf75681 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/closeness_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/closeness_cypher_endpoints.py @@ -33,8 +33,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessMutateResult: config = ConfigConverter.convert_to_gds_config( mutateProperty=mutate_property, @@ -68,8 +68,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessStatsResult: config = ConfigConverter.convert_to_gds_config( useWassermanFaust=use_wasserman_faust, @@ -102,8 +102,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( useWassermanFaust=use_wasserman_faust, @@ -134,8 +134,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ClosenessWriteResult: config = ConfigConverter.convert_to_gds_config( @@ -168,7 +168,7 @@ def estimate( use_wasserman_faust: bool = False, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: algo_config = ConfigConverter.convert_to_gds_config( useWassermanFaust=use_wasserman_faust, diff --git a/graphdatascience/procedure_surface/cypher/centrality/closeness_harmonic_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/closeness_harmonic_cypher_endpoints.py index 546110232..70a280a5f 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/closeness_harmonic_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/closeness_harmonic_cypher_endpoints.py @@ -32,8 +32,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessHarmonicMutateResult: config = ConfigConverter.convert_to_gds_config( mutateProperty=mutate_property, @@ -65,8 +65,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> ClosenessHarmonicStatsResult: config = ConfigConverter.convert_to_gds_config( relationshipTypes=relationship_types, @@ -97,8 +97,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( relationshipTypes=relationship_types, @@ -129,8 +129,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> ClosenessHarmonicWriteResult: config = ConfigConverter.convert_to_gds_config( @@ -161,7 +161,7 @@ def estimate( G: GraphV2 | dict[str, Any], relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: algo_config = ConfigConverter.convert_to_gds_config( relationshipTypes=relationship_types, diff --git a/graphdatascience/procedure_surface/cypher/centrality/degree_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/degree_cypher_endpoints.py index 28247acf7..6be91c296 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/degree_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/degree_cypher_endpoints.py @@ -31,8 +31,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DegreeMutateResult: config = ConfigConverter.convert_to_gds_config( @@ -68,8 +68,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DegreeStatsResult: config = ConfigConverter.convert_to_gds_config( @@ -104,8 +104,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( @@ -138,8 +138,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, write_concurrency: int | None = None, ) -> DegreeWriteResult: @@ -173,7 +173,7 @@ def estimate( orientation: str = "NATURAL", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, ) -> EstimationResult: algo_config = ConfigConverter.convert_to_gds_config( diff --git a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py index a772eef6a..6770c3fe0 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py @@ -39,8 +39,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> EigenvectorMutateResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -85,8 +85,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> EigenvectorStatsResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -129,8 +129,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -171,8 +171,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, write_concurrency: int | None = None, ) -> EigenvectorWriteResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -215,7 +215,7 @@ def estimate( relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler diff --git a/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py index d54b7f0e9..24a1500a5 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py @@ -41,8 +41,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> PageRankMutateResult: @@ -88,8 +88,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> PageRankStatsResult: @@ -134,8 +134,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> DataFrame: @@ -177,8 +177,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, write_concurrency: int | None = None, @@ -224,7 +224,7 @@ def estimate( scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_types: list[str] = ALL_TYPES, node_labels: list[str] = ALL_LABELS, - concurrency: Any | None = None, + concurrency: int | None = None, relationship_weight_property: str | None = None, source_nodes: Any | None = None, ) -> EstimationResult: diff --git a/graphdatascience/procedure_surface/cypher/community/hdbscan_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/community/hdbscan_cypher_endpoints.py index 5317ab24d..f743016ea 100644 --- a/graphdatascience/procedure_surface/cypher/community/hdbscan_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/community/hdbscan_cypher_endpoints.py @@ -40,7 +40,7 @@ def mutate( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanMutateResult: config = ConfigConverter.convert_to_gds_config( @@ -80,7 +80,7 @@ def stats( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanStatsResult: config = ConfigConverter.convert_to_gds_config( @@ -119,7 +119,7 @@ def stream( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( @@ -160,7 +160,7 @@ def write( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> HdbscanWriteResult: config = ConfigConverter.convert_to_gds_config( @@ -201,7 +201,7 @@ def estimate( concurrency: int | None = None, log_progress: bool = True, sudo: bool = False, - job_id: Any | None = None, + job_id: str | None = None, username: str | None = None, ) -> EstimationResult: config = ConfigConverter.convert_to_gds_config( diff --git a/graphdatascience/procedure_surface/cypher/similarity/knn_filtered_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/similarity/knn_filtered_cypher_endpoints.py index f4e7b42e4..07fd3de90 100644 --- a/graphdatascience/procedure_surface/cypher/similarity/knn_filtered_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/similarity/knn_filtered_cypher_endpoints.py @@ -44,8 +44,8 @@ def mutate( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> KnnMutateResult: config = ConfigConverter.convert_to_gds_config( mutateRelationshipType=mutate_relationship_type, @@ -99,8 +99,8 @@ def stats( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> KnnStatsResult: config = ConfigConverter.convert_to_gds_config( nodeProperties=node_properties, @@ -154,8 +154,8 @@ def stream( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> DataFrame: config = ConfigConverter.convert_to_gds_config( nodeProperties=node_properties, @@ -208,8 +208,8 @@ def write( sudo: bool = False, log_progress: bool = True, username: str | None = None, - concurrency: Any | None = None, - job_id: Any | None = None, + concurrency: int | None = None, + job_id: str | None = None, ) -> KnnWriteResult: config = ConfigConverter.convert_to_gds_config( writeRelationshipType=write_relationship_type, @@ -265,7 +265,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, sudo: bool = False, username: str | None = None, - concurrency: Any | None = None, + concurrency: int | None = None, ) -> EstimationResult: config = ConfigConverter.convert_to_gds_config( nodeProperties=node_properties, From 874e492e5a8934dcec43cc8b54af9af4fef29ebb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 15:53:53 +0100 Subject: [PATCH 2/9] Fix docstrings to not use new types --- .../api/catalog/node_label_endpoints.py | 6 +++--- .../api/catalog/node_properties_endpoints.py | 10 +++++----- .../api/catalog/scale_properties_endpoints.py | 4 ++-- .../api/centrality/articlerank_endpoints.py | 18 ++++++++--------- .../articulationpoints_endpoints.py | 20 +++++++++---------- .../api/centrality/betweenness_endpoints.py | 20 +++++++++---------- .../api/centrality/celf_endpoints.py | 6 +++--- .../api/centrality/closeness_endpoints.py | 16 +++++++-------- .../closeness_harmonic_endpoints.py | 20 +++++++++---------- .../api/centrality/degree_endpoints.py | 20 +++++++++---------- .../api/centrality/eigenvector_endpoints.py | 20 +++++++++---------- .../api/centrality/pagerank_endpoints.py | 18 ++++++++--------- .../api/community/hdbscan_endpoints.py | 10 +++++----- .../api/community/kcore_endpoints.py | 4 ++-- .../api/node_embedding/fastrp_endpoints.py | 20 +++++++++---------- .../api/node_embedding/graphsage_endpoints.py | 6 +++--- .../graphsage_predict_endpoints.py | 12 +++++------ .../graphsage_train_endpoints.py | 4 ++-- .../api/node_embedding/hashgnn_endpoints.py | 4 ++-- .../api/node_embedding/node2vec_endpoints.py | 14 ++++++------- 20 files changed, 126 insertions(+), 126 deletions(-) diff --git a/graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py b/graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py index 861bd3510..72fa35b89 100644 --- a/graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py +++ b/graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py @@ -82,11 +82,11 @@ def write( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads used for the mutation - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns ------- diff --git a/graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py b/graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py index 747acf6b8..117a28ef9 100644 --- a/graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py +++ b/graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py @@ -40,7 +40,7 @@ def stream( Whether to include node labels in the stream node_labels : list[str] Filter by node labels - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads sudo : bool Override memory estimation limits @@ -48,7 +48,7 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - job_id : Any | None, default=None + job_id : str | None An identifier for the job db_node_properties : list[str] | None, default=None Retrieves additional node properties from the database and attaches them to the stream. @@ -85,9 +85,9 @@ def write( If a dictionary is provided, the keys are the property names and the values are the aliases that will be used as the property name in the database. node_labels : list[str] Filter by node labels - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads used for writing sudo : bool Override memory estimation limits @@ -95,7 +95,7 @@ def write( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns ------- diff --git a/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py b/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py index 75fb35c42..7c6e8c0ac 100644 --- a/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py +++ b/graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py @@ -53,9 +53,9 @@ def mutate( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py index 01b521fb3..88c4a444a 100644 --- a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py @@ -68,9 +68,9 @@ def mutate( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -135,9 +135,9 @@ def stats( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -194,9 +194,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight @@ -265,9 +265,9 @@ def write( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -316,7 +316,7 @@ def estimate( The relationships types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight diff --git a/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py b/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py index 3e1ac4bb8..f3890647c 100644 --- a/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py @@ -46,9 +46,9 @@ def mutate( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns @@ -88,9 +88,9 @@ def stats( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns @@ -128,9 +128,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns @@ -176,11 +176,11 @@ def write( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads for writing Returns @@ -208,7 +208,7 @@ def estimate( The relationship types used to select relationships for this algorithm run. node_labels : list[str] The node labels used to select nodes for this algorithm run. - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the estimation. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py b/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py index b49bdd49d..43a7d4748 100644 --- a/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py @@ -56,9 +56,9 @@ def mutate( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -110,9 +110,9 @@ def stats( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -159,9 +159,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains relationship weights @@ -217,13 +217,13 @@ def write( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads during the write phase Returns @@ -258,7 +258,7 @@ def estimate( The relationship types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight diff --git a/graphdatascience/procedure_surface/api/centrality/celf_endpoints.py b/graphdatascience/procedure_surface/api/centrality/celf_endpoints.py index 87b340609..afc2dab9b 100644 --- a/graphdatascience/procedure_surface/api/centrality/celf_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/celf_endpoints.py @@ -101,7 +101,7 @@ def stats( Probability of a node being activated by an active neighbour node. monte_carlo_simulations : int | None, default=None Number of Monte-Carlo simulations. - random_seed : Any | None, default=None + random_seed : int | None Random seed for reproducible results. relationship_types : list[str] Filter the graph using the given relationship types. Relationships with any of the given types will be included. @@ -113,9 +113,9 @@ def stats( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py b/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py index 0909c0761..6ffeeedd8 100644 --- a/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py @@ -52,9 +52,9 @@ def mutate( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -101,9 +101,9 @@ def stats( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -200,11 +200,11 @@ def write( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads used during the write phase. Returns @@ -236,7 +236,7 @@ def estimate( The relationship types used to select relationships for this algorithm run. node_labels : list[str] The node labels used to select nodes for this algorithm run. - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py b/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py index b4c791f3e..946a86b40 100644 --- a/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py @@ -48,9 +48,9 @@ def mutate( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -95,9 +95,9 @@ def stats( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -137,9 +137,9 @@ def stream( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -188,11 +188,11 @@ def write( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads during the write phase Returns @@ -221,7 +221,7 @@ def estimate( The relationship types used to select relationships for this algorithm run. node_labels : list[str] The node labels used to select nodes for this algorithm run. - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py index 363941de9..a1ad9dd00 100644 --- a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py @@ -53,9 +53,9 @@ def mutate( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -105,9 +105,9 @@ def stats( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -156,9 +156,9 @@ def stream( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation relationship_weight_property : str | None, default=None The property name that contains relationship weights. If specified, @@ -215,13 +215,13 @@ def write( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads used during the write phase. Returns @@ -254,7 +254,7 @@ def estimate( The relationship types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight diff --git a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py index ad547464b..9b0bcc7af 100644 --- a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py @@ -70,9 +70,9 @@ def mutate( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -136,9 +136,9 @@ def stats( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -197,9 +197,9 @@ def stream( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation Returns @@ -267,11 +267,11 @@ def write( Whether to log progress of the algorithm execution username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. - job_id : Any | None, default=None + job_id : str | None An identifier for the job that can be used for monitoring and cancellation - write_concurrency : Any | None, default=None + write_concurrency : int | None The number of concurrent threads during the write phase Returns @@ -319,7 +319,7 @@ def estimate( The relationship types used to select relationships for this algorithm run. node_labels : list[str] The node labels used to select nodes for this algorithm run. - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads used for the algorithm execution. Returns diff --git a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py index cd6af3349..93b931cab 100644 --- a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py @@ -66,9 +66,9 @@ def mutate( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -132,9 +132,9 @@ def stats( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -195,9 +195,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight @@ -265,9 +265,9 @@ def write( Display progress logging. username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None Number of threads to use for running the algorithm. - job_id : Any | None, default=None + job_id : str | None Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. @@ -320,7 +320,7 @@ def estimate( The relationships types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight diff --git a/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py b/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py index 8910d9618..a8739c247 100644 --- a/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py @@ -60,7 +60,7 @@ def mutate( Whether to log progress sudo : bool Override memory estimation limits - job_id : Any | None, default=None + job_id : str | None An identifier for the job username : str | None, default=None The username to attribute the procedure run to @@ -116,7 +116,7 @@ def stats( Whether to log progress sudo : bool Override memory estimation limits - job_id : Any | None, default=None + job_id : str | None An identifier for the job username : str | None, default=None The username to attribute the procedure run to @@ -172,7 +172,7 @@ def stream( Whether to log progress sudo : bool Override memory estimation limits - job_id : Any | None, default=None + job_id : str | None An identifier for the job username : str | None, default=None The username to attribute the procedure run to @@ -231,7 +231,7 @@ def write( Whether to log progress sudo : bool Override memory estimation limits - job_id : Any | None, default=None + job_id : str | None An identifier for the job username : str | None, default=None The username to attribute the procedure run to @@ -284,7 +284,7 @@ def estimate( Whether to log progress sudo : bool Override memory estimation limits - job_id : Any | None, default=None + job_id : str | None An identifier for the job username : str | None, default=None The username to attribute the procedure run to diff --git a/graphdatascience/procedure_surface/api/community/kcore_endpoints.py b/graphdatascience/procedure_surface/api/community/kcore_endpoints.py index be10f56dd..99b1125a9 100644 --- a/graphdatascience/procedure_surface/api/community/kcore_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/kcore_endpoints.py @@ -133,9 +133,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job Returns diff --git a/graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py index e8523680a..33cba9c53 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py @@ -72,13 +72,13 @@ def mutate( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight - random_seed : Any | None, default=None + random_seed : int | None Random seed for reproducible results Returns @@ -137,9 +137,9 @@ def stats( Whether to log progress username : str | None = None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight @@ -202,9 +202,9 @@ def stream( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight @@ -271,9 +271,9 @@ def write( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight @@ -328,7 +328,7 @@ def estimate( The relationship types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight diff --git a/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py index 4fd20b057..6e80fe254 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py @@ -79,15 +79,15 @@ def train(self) -> GraphSageTrainEndpoints: Whether to log progress sudo : bool Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job batch_size : int | None, default=None Batch size for training relationship_weight_property : str | None, default=None The property name that contains weight - random_seed : Any | None, default=None + random_seed : int | None Random seed for reproducible results Returns diff --git a/graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py index 525ea2415..747bded4d 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py @@ -50,9 +50,9 @@ def stream( Whether to log progress sudo : bool = False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job batch_size : int = 100 Batch size for training @@ -101,11 +101,11 @@ def write( Whether to log progress sudo : bool = False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads write_concurrency : int | None, default=None The number of concurrent threads used for writing - job_id : Any | None, default=None + job_id : str | None An identifier for the job batch_size : int = 100 Batch size for training @@ -152,9 +152,9 @@ def mutate( Whether to log progress sudo : bool Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job batch_size : int | None, default=None Batch size for training diff --git a/graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py index 15ea0b849..22a624d93 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py @@ -129,9 +129,9 @@ def estimate( Whether to log progress sudo : bool = False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job batch_size : int = 100 Batch size for training diff --git a/graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py index 52098616e..9a641423c 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py @@ -186,9 +186,9 @@ def write( Whether to log progress username : str | None, default=None The username to attribute the procedure run to - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job write_concurrency : int | None, default=None The number of concurrent threads used for writing diff --git a/graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py index 5c396588f..7295717f0 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py @@ -82,9 +82,9 @@ def mutate( Whether to log progress sudo : bool, default=False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job walk_length : int, default=80 The length of each random walk @@ -170,9 +170,9 @@ def stream( Whether to log progress sudo : bool, default=False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job walk_length : int, default=80 The length of each random walk @@ -262,9 +262,9 @@ def write( Whether to log progress sudo : bool, default=False Override memory estimation limits - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads - job_id : Any | None, default=None + job_id : str | None An identifier for the job walk_length : int, default=80 The length of each random walk @@ -342,7 +342,7 @@ def estimate( The relationship types used to select relationships for this algorithm run node_labels : list[str] The node labels used to select nodes for this algorithm run - concurrency : Any | None, default=None + concurrency : int | None The number of concurrent threads walk_length : int, default=80 The length of each random walk From da584214024f3b0c5000a561c65501a31f95cfcb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 16:54:57 +0100 Subject: [PATCH 3/9] Clarify source_nodes type --- .../api/centrality/articlerank_endpoints.py | 45 ++++++++++++------- .../api/centrality/degree_endpoints.py | 10 ++--- .../api/centrality/eigenvector_endpoints.py | 45 ++++++++++++------- .../api/centrality/pagerank_endpoints.py | 31 ++++++++----- .../api/community/sllpa_endpoints.py | 10 ++--- .../api/node_embedding/graphsage_endpoints.py | 4 +- .../centrality/articlerank_arrow_endpoints.py | 10 ++--- .../centrality/eigenvector_arrow_endpoints.py | 10 ++--- .../centrality/pagerank_arrow_endpoints.py | 10 ++--- .../articlerank_cypher_endpoints.py | 10 ++--- .../eigenvector_cypher_endpoints.py | 10 ++--- .../centrality/pagerank_cypher_endpoints.py | 10 ++--- .../test_articlerank_arrow_endpoints.py | 4 +- .../test_eigenvector_arrow_endpoints.py | 14 +++--- .../test_pagerank_arrow_endpoints.py | 15 ++++--- 15 files changed, 143 insertions(+), 95 deletions(-) diff --git a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py index 88c4a444a..afc3d23d5 100644 --- a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py @@ -31,7 +31,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankMutateResult: """ Runs the Article Rank algorithm and stores the results in the graph catalog as a new node property. @@ -74,8 +74,11 @@ def mutate( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- @@ -100,7 +103,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankStatsResult: """ Runs the Article Rank algorithm and returns result statistics without storing the results. @@ -141,8 +144,11 @@ def stats( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- @@ -167,7 +173,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: """ Executes the ArticleRank algorithm and returns the results as a stream. @@ -200,8 +206,11 @@ def stream( An identifier for the job relationship_weight_property : str | None, default=None The property name that contains weight - source_nodes : Any | None, default=None - The source nodes for personalized ArticleRank + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- @@ -227,7 +236,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> ArticleRankWriteResult: """ @@ -271,8 +280,11 @@ def write( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) write_concurrency : int | None, default=None The number of concurrent threads used for writing @@ -295,7 +307,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: """ Estimate the memory consumption of an algorithm run. @@ -320,8 +332,11 @@ def estimate( The number of concurrent threads relationship_weight_property : str | None, default=None The property name that contains weight - source_nodes : Any | None, default=None - The source nodes for personalized ArticleRank + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- diff --git a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py index a1ad9dd00..d2402f1dd 100644 --- a/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/degree_endpoints.py @@ -41,7 +41,7 @@ def mutate( The graph to run the algorithm on mutate_property : str Name of the node property to store the results in. - orientation : Any | None, default=None + orientation : str | None The orientation of relationships to consider. Can be 'NATURAL', 'REVERSE', or 'UNDIRECTED'. relationship_types : list[str] Filter the graph using the given relationship types. Relationships with any of the given types will be included. @@ -93,7 +93,7 @@ def stats( ---------- G : GraphV2 The graph to run the algorithm on - orientation : Any | None, default=None + orientation : str | None The orientation of relationships to consider. Can be 'NATURAL', 'REVERSE', or 'UNDIRECTED'. relationship_types : list[str] Filter the graph using the given relationship types. Relationships with any of the given types will be included. @@ -140,7 +140,7 @@ def stream( ---------- G : GraphV2 The graph to run the algorithm on - orientation : Any | None, default=None + orientation : str | None The orientation of relationships to consider. Can be 'NATURAL', 'REVERSE', or 'UNDIRECTED'. 'NATURAL' (default) respects the direction of relationships as they are stored in the graph. 'REVERSE' treats each relationship as if it were directed in the opposite direction. @@ -203,7 +203,7 @@ def write( The graph to run the algorithm on write_property : str The property name to store the degree centrality score for each node in the database - orientation : Any | None, default=None + orientation : str | None The orientation of relationships to consider. Can be 'NATURAL', 'REVERSE', or 'UNDIRECTED'. relationship_types : list[str] Filter the graph using the given relationship types. Relationships with any of the given types will be included. @@ -248,7 +248,7 @@ def estimate( ---------- G : GraphV2 | dict[str, Any] The graph to run the algorithm on or a dictionary representing the graph. - orientation : Any | None, default=None + orientation : str | None The orientation of relationships to consider. Can be 'NATURAL', 'REVERSE', or 'UNDIRECTED'. relationship_types : list[str] The relationship types used to select relationships for this algorithm run diff --git a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py index 9b0bcc7af..8a816a92b 100644 --- a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py @@ -20,7 +20,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -49,8 +49,11 @@ def mutate( The maximum number of iterations to run the algorithm tolerance : float The tolerance for convergence detection - source_nodes : Any | None, default=None - The source nodes to start the computation from + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -88,7 +91,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -115,8 +118,11 @@ def stats( The maximum number of iterations to run the algorithm tolerance : float The tolerance for convergence detection - source_nodes : Any | None, default=None - The source nodes to start the computation from + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -154,7 +160,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -176,8 +182,11 @@ def stream( The maximum number of iterations to run the algorithm tolerance : float The tolerance for convergence detection - source_nodes : Any | None, default=None - The source nodes to start the computation from + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -216,7 +225,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -246,8 +255,11 @@ def write( The maximum number of iterations to run the algorithm tolerance : float The tolerance for convergence detection - source_nodes : Any | None, default=None - The source nodes to start the computation from + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -287,7 +299,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -305,8 +317,11 @@ def estimate( The maximum number of iterations to run the algorithm tolerance : float The tolerance for convergence detection - source_nodes : Any | None, default=None - The source nodes to start the computation from + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') diff --git a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py index 93b931cab..149ae53b4 100644 --- a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py @@ -30,7 +30,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankMutateResult: """ Runs the PageRank algorithm and stores the results in the graph catalog as a new node property. @@ -72,8 +72,11 @@ def mutate( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- @@ -98,7 +101,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankStatsResult: """ Runs the PageRank algorithm and returns result statistics without storing the results. @@ -138,8 +141,11 @@ def stats( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) Returns ------- @@ -164,7 +170,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: """ Executes the PageRank algorithm and returns a stream of results. @@ -228,7 +234,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> PageRankWriteResult: """ @@ -271,8 +277,11 @@ def write( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : Any | None, default=None - List of node ids to use as starting points. Use a list of list pairs to associate each node with a bias > 0. + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + node ids to use as starting points. Can be: + - single node id (e.g., 42) + - list of node id (e.g., [42, 43, 44]) + - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) write_concurrency : int | None, default=None The number of concurrent threads used for writing @@ -295,7 +304,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: """ Estimate the memory consumption of an algorithm run. diff --git a/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py b/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py index e9c4285ef..315ca0d9c 100644 --- a/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py @@ -50,7 +50,7 @@ def mutate( Minimum association strength for community assignment node_labels : list[str] Filter nodes with specific labels - partitioning : Any | None, default=None + partitioning : str | None Partitioning configuration for the algorithm relationship_types : list[str] Filter relationships with specific types @@ -99,7 +99,7 @@ def stats( Minimum association strength for community assignment node_labels : list[str] Filter nodes with specific labels - partitioning : Any | None, default=None + partitioning : str | None Partitioning configuration for the algorithm relationship_types : list[str] Filter relationships with specific types @@ -148,7 +148,7 @@ def stream( Minimum association strength for community assignment node_labels : list[str] Filter nodes with specific labels - partitioning : Any | None, default=None + partitioning : str | None Partitioning configuration for the algorithm relationship_types : list[str] Filter relationships with specific types @@ -201,7 +201,7 @@ def write( Minimum association strength for community assignment node_labels : list[str] Filter nodes with specific labels - partitioning : Any | None, default=None + partitioning : str | None Partitioning configuration for the algorithm relationship_types : list[str] Filter relationships with specific types @@ -244,7 +244,7 @@ def estimate( Minimum association strength for community assignment node_labels : list[str] Filter nodes with specific labels - partitioning : Any | None, default=None + partitioning : str | None Partitioning configuration for the algorithm relationship_types : list[str] Filter relationships with specific types diff --git a/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py b/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py index 6e80fe254..1ad9d0109 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py +++ b/graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py @@ -41,7 +41,7 @@ def train(self) -> GraphSageTrainEndpoints: Name under which the model will be stored feature_properties : list[str] The names of the node properties to use as input features - activation_function : Any | None, default=None + activation_function : str | None The activation function to apply after each layer negative_sample_weight : int | None, default=None Weight of negative samples in the loss function @@ -55,7 +55,7 @@ def train(self) -> GraphSageTrainEndpoints: Maximum number of training iterations sample_sizes : list[int] | None, default=None Number of neighbors to sample at each layer - aggregator : Any | None, default=None + aggregator : str | None The aggregator function for neighborhood aggregation penalty_l2 : float | None, default=None L2 regularization penalty diff --git a/graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py index a00728358..4984be373 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py @@ -46,7 +46,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankMutateResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = self._node_property_endpoints.create_base_config( @@ -85,7 +85,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankStatsResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = self._node_property_endpoints.create_base_config( @@ -124,7 +124,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = self._node_property_endpoints.create_base_config( @@ -162,7 +162,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> ArticleRankWriteResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -205,7 +205,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = self._node_property_endpoints.create_estimate_config( diff --git a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py index 8759363f0..7978d61b6 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py @@ -35,7 +35,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -72,7 +72,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -109,7 +109,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -145,7 +145,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -190,7 +190,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, diff --git a/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py index 3964764fc..37f74c25a 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py @@ -45,7 +45,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankMutateResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -85,7 +85,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankStatsResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -125,7 +125,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -164,7 +164,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> PageRankWriteResult: # Convert ScalerConfig to dict if needed @@ -207,7 +207,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler diff --git a/graphdatascience/procedure_surface/cypher/centrality/articlerank_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/articlerank_cypher_endpoints.py index 8a6a323ec..aee36b42a 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/articlerank_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/articlerank_cypher_endpoints.py @@ -45,7 +45,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankMutateResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -92,7 +92,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> ArticleRankStatsResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = ConfigConverter.convert_to_gds_config( @@ -137,7 +137,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler config = ConfigConverter.convert_to_gds_config( @@ -179,7 +179,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> ArticleRankWriteResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -223,7 +223,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler algo_config = ConfigConverter.convert_to_gds_config( diff --git a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py index 6770c3fe0..b583a36b1 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py @@ -31,7 +31,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -77,7 +77,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -121,7 +121,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -163,7 +163,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -210,7 +210,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, diff --git a/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py index 24a1500a5..7d73b1f10 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py @@ -44,7 +44,7 @@ def mutate( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankMutateResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -91,7 +91,7 @@ def stats( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> PageRankStatsResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -137,7 +137,7 @@ def stream( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> DataFrame: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler @@ -180,7 +180,7 @@ def write( concurrency: int | None = None, job_id: str | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, write_concurrency: int | None = None, ) -> PageRankWriteResult: # Convert ScalerConfig to dict if needed @@ -226,7 +226,7 @@ def estimate( node_labels: list[str] = ALL_LABELS, concurrency: int | None = None, relationship_weight_property: str | None = None, - source_nodes: Any | None = None, + source_nodes: int | list[int] | list[tuple[int, float]] | None = None, ) -> EstimationResult: # Convert ScalerConfig to dict if needed scaler_value = scaler.model_dump() if isinstance(scaler, BaseModel) else scaler diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py index 37b3310d2..a46c8f606 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py @@ -51,7 +51,7 @@ def articlerank_endpoints(arrow_client: AuthenticatedArrowClient) -> Generator[A def test_articlerank_stats(articlerank_endpoints: ArticleRankArrowEndpoints, sample_graph: GraphV2) -> None: """Test ArticleRank stats operation.""" - result = articlerank_endpoints.stats(G=sample_graph) + result = articlerank_endpoints.stats(G=sample_graph, source_nodes=[0, 1]) assert result.ran_iterations > 0 assert result.did_converge @@ -65,6 +65,7 @@ def test_articlerank_stream(articlerank_endpoints: ArticleRankArrowEndpoints, sa """Test ArticleRank stream operation.""" result_df = articlerank_endpoints.stream( G=sample_graph, + source_nodes=0, ) assert "nodeId" in result_df.columns @@ -78,6 +79,7 @@ def test_articlerank_mutate(articlerank_endpoints: ArticleRankArrowEndpoints, sa result = articlerank_endpoints.mutate( G=sample_graph, mutate_property="articlerank", + source_nodes=[(0, 0.6), (1, 0.4)], ) assert result.ran_iterations > 0 diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py index 8f53342cf..2b146bf07 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py @@ -15,10 +15,10 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), - (d: Node), + (a: Node {id: 0}), + (b: Node {id: 1}), + (c: Node {id: 2}), + (d: Node {id: 3}), (a)-[:REL]->(b), (b)-[:REL]->(c), (c)-[:REL]->(d), @@ -41,7 +41,7 @@ def db_graph(arrow_client: AuthenticatedArrowClient, query_runner: QueryRunner) graph, """ MATCH (n)-->(m) - WITH gds.graph.project.remote(n, m) as g + WITH gds.graph.project.remote(n, m, {sourceNodeProperties: properties(n), targetNodeProperties: properties(m)}) as g RETURN g """, ) as g: @@ -55,7 +55,7 @@ def eigenvector_endpoints(arrow_client: AuthenticatedArrowClient) -> Generator[E def test_eigenvector_stats(eigenvector_endpoints: EigenvectorArrowEndpoints, sample_graph: GraphV2) -> None: """Test Eigenvector stats operation.""" - result = eigenvector_endpoints.stats(G=sample_graph) + result = eigenvector_endpoints.stats(G=sample_graph, source_nodes=[0, 1]) assert result.compute_millis >= 0 assert result.pre_processing_millis >= 0 @@ -69,6 +69,7 @@ def test_eigenvector_stream(eigenvector_endpoints: EigenvectorArrowEndpoints, sa """Test Eigenvector stream operation.""" result_df = eigenvector_endpoints.stream( G=sample_graph, + source_nodes=1, ) assert "nodeId" in result_df.columns @@ -81,6 +82,7 @@ def test_eigenvector_mutate(eigenvector_endpoints: EigenvectorArrowEndpoints, sa result = eigenvector_endpoints.mutate( G=sample_graph, mutate_property="eigenvector", + source_nodes=[(0, 0.8), (1, 0.2)], ) assert result.pre_processing_millis >= 0 diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py index dba2b9fb5..276b1c41d 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py @@ -12,12 +12,13 @@ create_graph, create_graph_from_db, ) +from graphdatascience.tests.integrationV2.procedure_surface.node_lookup_helper import find_node_by_id graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), + (a: Node {id: 0}), + (b: Node {id: 1}), + (c: Node {id: 2}), (a)-[:REL]->(c), (b)-[:REL]->(c) """ @@ -38,7 +39,7 @@ def db_graph(arrow_client: AuthenticatedArrowClient, query_runner: QueryRunner) graph, """ MATCH (n)-->(m) - WITH gds.graph.project.remote(n, m) as g + WITH gds.graph.project.remote(n, m, {sourceNodeProperties: properties(n), targetNodeProperties: properties(m)}) as g RETURN g """, ) as g: @@ -67,6 +68,7 @@ def test_pagerank_stream(pagerank_endpoints: PageRankArrowEndpoints, sample_grap """Test PageRank stream operation.""" result_df = pagerank_endpoints.stream( G=sample_graph, + source_nodes=[0, 1], ) assert "nodeId" in result_df.columns @@ -80,6 +82,7 @@ def test_pagerank_mutate(pagerank_endpoints: PageRankArrowEndpoints, sample_grap result = pagerank_endpoints.mutate( G=sample_graph, mutate_property="pagerank", + source_nodes=0, ) assert result.ran_iterations > 0 @@ -98,7 +101,9 @@ def test_pagerank_write(arrow_client: AuthenticatedArrowClient, query_runner: Qu endpoints = PageRankArrowEndpoints( arrow_client, RemoteWriteBackClient(arrow_client, query_runner), show_progress=True ) - result = endpoints.write(G=db_graph, write_property="pagerank") + result = endpoints.write( + G=db_graph, write_property="pagerank", source_nodes=[(find_node_by_id(query_runner, 0), 0.7)] + ) assert isinstance(result, PageRankWriteResult) assert result.ran_iterations > 0 From 0c89acead7df3c0ae7ffdfec8a017bfb5feeaecf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 17:13:16 +0100 Subject: [PATCH 4/9] Remove space in test node label --- .../centrality/test_articlerank_arrow_endpoints.py | 6 +++--- .../test_articulationpoints_arrow_endpoints.py | 6 +++--- .../centrality/test_betweenness_arrow_endpoints.py | 6 +++--- .../arrow/centrality/test_celf_arrow_endpoints.py | 10 +++++----- .../arrow/centrality/test_closeness_arrow_endpoints.py | 8 ++++---- .../test_closeness_harmonic_arrow_endpoints.py | 8 ++++---- .../arrow/centrality/test_degree_arrow_endpoints.py | 6 +++--- .../centrality/test_eigenvector_arrow_endpoints.py | 8 ++++---- .../arrow/centrality/test_pagerank_arrow_endpoints.py | 6 +++--- 9 files changed, 32 insertions(+), 32 deletions(-) diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py index a46c8f606..f99355e19 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articlerank_arrow_endpoints.py @@ -14,9 +14,9 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), + (a:Node), + (b:Node), + (c:Node), (a)-[:REL]->(c), (b)-[:REL]->(c) """ diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articulationpoints_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articulationpoints_arrow_endpoints.py index 95a28bc24..adf343928 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articulationpoints_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_articulationpoints_arrow_endpoints.py @@ -21,9 +21,9 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), + (a:Node), + (b:Node), + (c:Node), (a)-[:REL]->(c), (b)-[:REL]->(c) """ diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_betweenness_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_betweenness_arrow_endpoints.py index ef2dbe917..b489366a0 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_betweenness_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_betweenness_arrow_endpoints.py @@ -19,9 +19,9 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), + (a:Node), + (b:Node), + (c:Node), (a)-[:REL]->(b), (b)-[:REL]->(c) """ diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_celf_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_celf_arrow_endpoints.py index 005e344a7..17f3fdd9a 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_celf_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_celf_arrow_endpoints.py @@ -15,11 +15,11 @@ graph = """ CREATE - (a: Node {id: 0}), - (b: Node {id: 1}), - (c: Node {id: 2}), - (d: Node {id: 3}), - (e: Node {id: 4}), + (a:Node {id: 0}), + (b:Node {id: 1}), + (c:Node {id: 2}), + (d:Node {id: 3}), + (e:Node {id: 4}), (a)-[:REL]->(b), (a)-[:REL]->(c), (b)-[:REL]->(d), diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_arrow_endpoints.py index c13800fd2..352b23dc1 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_arrow_endpoints.py @@ -15,10 +15,10 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), - (d: Node), + (a:Node), + (b:Node), + (c:Node), + (d:Node), (a)-[:REL]->(b), (b)-[:REL]->(c), (c)-[:REL]->(d) diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_harmonic_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_harmonic_arrow_endpoints.py index bfac942c1..b4544a29e 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_harmonic_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_closeness_harmonic_arrow_endpoints.py @@ -17,10 +17,10 @@ graph = """ CREATE - (a: Node), - (b: Node), - (c: Node), - (d: Node), + (a:Node), + (b:Node), + (c:Node), + (d:Node), (a)-[:REL]->(b), (b)-[:REL]->(c), (c)-[:REL]->(d) diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_degree_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_degree_arrow_endpoints.py index 17ed3e25a..9f9626524 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_degree_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_degree_arrow_endpoints.py @@ -15,9 +15,9 @@ graph = """ CREATE - (a: Node {id: 0}), - (b: Node {id: 1}), - (c: Node {id: 2}), + (a:Node {id: 0}), + (b:Node {id: 1}), + (c:Node {id: 2}), (a)-[:REL]->(c), (b)-[:REL]->(c) """ diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py index 2b146bf07..0bdbf76df 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py @@ -15,10 +15,10 @@ graph = """ CREATE - (a: Node {id: 0}), - (b: Node {id: 1}), - (c: Node {id: 2}), - (d: Node {id: 3}), + (a:Node {id: 0}), + (b:Node {id: 1}), + (c:Node {id: 2}), + (d:Node {id: 3}), (a)-[:REL]->(b), (b)-[:REL]->(c), (c)-[:REL]->(d), diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py index 276b1c41d..82300ee51 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_pagerank_arrow_endpoints.py @@ -16,9 +16,9 @@ graph = """ CREATE - (a: Node {id: 0}), - (b: Node {id: 1}), - (c: Node {id: 2}), + (a:Node {id: 0}), + (b:Node {id: 1}), + (c:Node {id: 2}), (a)-[:REL]->(c), (b)-[:REL]->(c) """ From a17ade6b2e18a762946373731dd489094b7956d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 17:13:55 +0100 Subject: [PATCH 5/9] Fix default value for concurrency in remote projection the java code expects the input to be not present or a valid number. NULL is not accepted --- .../arrow/catalog_arrow_endpoints.py | 5 ++-- .../protocol/project_protocols.py | 27 +++++++++++-------- 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py index 1ca46bcf0..f25f5bddc 100644 --- a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py @@ -114,11 +114,12 @@ def project( job_id = job_id if job_id is not None else str(uuid4()) - params = { - "concurrency": concurrency, + params: dict[str, Any] = { "undirected_relationship_types": undirected_relationship_types, "inverse_indexed_relationship_types": inverse_indexed_relationship_types, } + if concurrency is not None: + params["concurrency"] = concurrency project_params = self._project_protocol.project_params(graph_name, query, job_id, params, arrow_config) diff --git a/graphdatascience/query_runner/protocol/project_protocols.py b/graphdatascience/query_runner/protocol/project_protocols.py index 3492a8d13..7bed6a0b4 100644 --- a/graphdatascience/query_runner/protocol/project_protocols.py +++ b/graphdatascience/query_runner/protocol/project_protocols.py @@ -51,7 +51,7 @@ def project_params( return CallParameters( graph_name=graph_name, query=query, - concurrency=params["concurrency"], + concurrency=params.get("concurrency", 4), undirected_relationship_types=params["undirected_relationship_types"], inverse_indexed_relationship_types=params["inverse_indexed_relationship_types"], arrow_configuration=arrow_config, @@ -77,15 +77,17 @@ class ProjectProtocolV2(ProjectProtocol): def project_params( self, graph_name: str, query: str, job_id: str, params: dict[str, Any], arrow_config: dict[str, Any] ) -> CallParameters: + config = { + "undirectedRelationshipTypes": params["undirected_relationship_types"], + "inverseIndexedRelationshipTypes": params["inverse_indexed_relationship_types"], + } + if "concurrency" in params: + config["concurrency"] = params["concurrency"] return CallParameters( graph_name=graph_name, query=query, arrow_configuration=arrow_config, - configuration={ - "concurrency": params["concurrency"], - "undirectedRelationshipTypes": params["undirected_relationship_types"], - "inverseIndexedRelationshipTypes": params["inverse_indexed_relationship_types"], - }, + configuration=config, ) def run_projection( @@ -108,16 +110,19 @@ class ProjectProtocolV3(ProjectProtocol): def project_params( self, graph_name: str, query: str, job_id: str, params: dict[str, Any], arrow_config: dict[str, Any] ) -> CallParameters: + config = { + "undirectedRelationshipTypes": params["undirected_relationship_types"], + "inverseIndexedRelationshipTypes": params["inverse_indexed_relationship_types"], + } + if "concurrency" in params: + config["concurrency"] = params["concurrency"] + return CallParameters( graph_name=graph_name, query=query, job_id=job_id, arrow_configuration=arrow_config, - configuration={ - "concurrency": params["concurrency"], - "undirectedRelationshipTypes": params["undirected_relationship_types"], - "inverseIndexedRelationshipTypes": params["inverse_indexed_relationship_types"], - }, + configuration=config, ) def run_projection( From 5dfc46964bd14e5fadb39c93dd1f5e3fafa75cac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 19:51:03 +0100 Subject: [PATCH 6/9] Remove bias option from source-nodes param in eigenvector --- .../api/centrality/eigenvector_endpoints.py | 15 +++++---------- .../centrality/eigenvector_arrow_endpoints.py | 10 +++++----- .../centrality/eigenvector_cypher_endpoints.py | 10 +++++----- .../test_eigenvector_arrow_endpoints.py | 2 +- 4 files changed, 16 insertions(+), 21 deletions(-) diff --git a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py index 8a816a92b..6d928a908 100644 --- a/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py @@ -20,7 +20,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -53,7 +53,6 @@ def mutate( node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -91,7 +90,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -122,7 +121,6 @@ def stats( node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -160,7 +158,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -186,7 +184,6 @@ def stream( node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -225,7 +222,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -259,7 +256,6 @@ def write( node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') @@ -299,7 +295,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -321,7 +317,6 @@ def estimate( node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) scaler : str | dict[str, str | int | float] | ScalerConfig, default="NONE" The scaler to use. Can be: - A string (e.g., 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center', 'NONE') diff --git a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py index 7978d61b6..046c67194 100644 --- a/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py @@ -35,7 +35,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -72,7 +72,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -109,7 +109,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -145,7 +145,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -190,7 +190,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, diff --git a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py index b583a36b1..806715e06 100644 --- a/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py +++ b/graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py @@ -31,7 +31,7 @@ def mutate( mutate_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -77,7 +77,7 @@ def stats( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -121,7 +121,7 @@ def stream( G: GraphV2, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -163,7 +163,7 @@ def write( write_property: str, max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, @@ -210,7 +210,7 @@ def estimate( G: GraphV2 | dict[str, Any], max_iterations: int = 20, tolerance: float = 1.0e-7, - source_nodes: int | list[int] | list[tuple[int, float]] | None = None, + source_nodes: int | list[int] | None = None, scaler: str | dict[str, str | int | float] | ScalerConfig = "NONE", relationship_weight_property: str | None = None, relationship_types: list[str] = ALL_TYPES, diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py index 0bdbf76df..bbb477752 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/centrality/test_eigenvector_arrow_endpoints.py @@ -82,7 +82,7 @@ def test_eigenvector_mutate(eigenvector_endpoints: EigenvectorArrowEndpoints, sa result = eigenvector_endpoints.mutate( G=sample_graph, mutate_property="eigenvector", - source_nodes=[(0, 0.8), (1, 0.2)], + source_nodes=[0, 2], ) assert result.pre_processing_millis >= 0 From 01bebc6313e5800689d86cb18158c61b2bdb9248 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 19:46:30 +0100 Subject: [PATCH 7/9] Init api-ref docs for v2 endpoints --- doc/sphinx/source/conf.py | 11 ++ doc/sphinx/source/index.rst | 9 +- .../source/sessions/aura_graphdatascience.rst | 7 + doc/sphinx/source/sessions/index.rst | 15 ++ .../source/sessions/session_v2_endpoints.rst | 7 + .../v2_endpoints/catalog_arrow_endpoints.rst | 6 + .../source/v2_endpoints/catalog_endpoints.rst | 6 + .../v2_endpoints/centrality_endpoints.rst | 6 + .../v2_endpoints/community_endpoints.rst | 6 + .../source/v2_endpoints/estimation_result.rst | 6 + doc/sphinx/source/v2_endpoints/index.rst | 11 ++ .../v2_endpoints/node_embedding_endpoints.rst | 6 + .../v2_endpoints/pathfinding_endpoints.rst | 6 + .../v2_endpoints/similarity_endpoints.rst | 6 + .../procedure_surface/api/__init__.py | 3 + .../procedure_surface/api/catalog/__init__.py | 77 +++++++++ .../api/catalog/scaler_config.py | 21 +-- .../api/centrality/__init__.py | 93 +++++++++++ .../api/centrality/articlerank_endpoints.py | 2 +- .../api/centrality/pagerank_endpoints.py | 6 +- .../api/community/__init__.py | 146 ++++++++++++++++++ .../api/community/maxkcut_endpoints.py | 21 --- .../api/community/sllpa_endpoints.py | 59 ------- .../api/community/triangle_count_endpoints.py | 65 -------- .../api/node_embedding/__init__.py | 45 ++++++ .../api/pathfinding/__init__.py | 101 ++++++++++++ .../api/similarity/__init__.py | 29 ++++ .../arrow/catalog/__init__.py | 3 + .../{ => catalog}/catalog_arrow_endpoints.py | 5 + graphdatascience/session/__init__.py | 2 + .../session/aura_graph_data_science.py | 4 + .../session/session_v2_endpoints.py | 119 +++++++++++++- .../catalog/test_catalog_arrow_endpoints.py | 2 +- .../arrow/graph_creation_helper.py | 2 +- requirements/dev/dev.txt | 1 + 35 files changed, 743 insertions(+), 171 deletions(-) create mode 100644 doc/sphinx/source/sessions/aura_graphdatascience.rst create mode 100644 doc/sphinx/source/sessions/index.rst create mode 100644 doc/sphinx/source/sessions/session_v2_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/catalog_arrow_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/catalog_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/centrality_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/community_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/estimation_result.rst create mode 100644 doc/sphinx/source/v2_endpoints/index.rst create mode 100644 doc/sphinx/source/v2_endpoints/node_embedding_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/pathfinding_endpoints.rst create mode 100644 doc/sphinx/source/v2_endpoints/similarity_endpoints.rst rename graphdatascience/procedure_surface/arrow/{ => catalog}/catalog_arrow_endpoints.py (97%) diff --git a/doc/sphinx/source/conf.py b/doc/sphinx/source/conf.py index 27eed77ca..6ada2ebef 100644 --- a/doc/sphinx/source/conf.py +++ b/doc/sphinx/source/conf.py @@ -25,6 +25,7 @@ "sphinx.ext.autodoc", # include docs from docstrings "enum_tools.autoenum", # specialised autoclass for enums "sphinx.ext.napoleon", # Support for NumPy and Google style docstrings + "sphinxcontrib.autodoc_pydantic", # Support for Pydantic models ] autodoc_class_signature = "separated" @@ -32,6 +33,16 @@ templates_path = ["_templates"] exclude_patterns = [] # type: ignore +# -- Options for Autodoc Pydantic ------------------------------------------------ +autodoc_pydantic_model_show_json = False +autodoc_pydantic_settings_show_json = False +autodoc_pydantic_model_show_config_summary = False +autodoc_pydantic_model_show_field_summary = False +autodoc_pydantic_field_show_alias = False +autodoc_pydantic_field_show_required = False +autodoc_pydantic_field_show_optional = False +autodoc_pydantic_field_show_default = False + # -- Options for HTML output ------------------------------------------------- # https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output diff --git a/doc/sphinx/source/index.rst b/doc/sphinx/source/index.rst index 2eaa4fac8..47734afb9 100644 --- a/doc/sphinx/source/index.rst +++ b/doc/sphinx/source/index.rst @@ -9,7 +9,7 @@ Neo4j Graph Data Science Python Client API Reference This API reference manual lists all available endpoints in the Neo4j Graph Data Science Python Client |api-version|. .. toctree:: - :maxdepth: 1 + :maxdepth: 2 :caption: Contents graphdatascience @@ -31,8 +31,5 @@ This API reference manual lists all available endpoints in the Neo4j Graph Data model/simple_rel_embedding_model misc server_version - sessions/gds_sessions - sessions/dbms_connection_info - sessions/session_memory - sessions/algorithm_category - sessions/cloud_location + sessions/index + v2_endpoints/index diff --git a/doc/sphinx/source/sessions/aura_graphdatascience.rst b/doc/sphinx/source/sessions/aura_graphdatascience.rst new file mode 100644 index 000000000..df97c10c6 --- /dev/null +++ b/doc/sphinx/source/sessions/aura_graphdatascience.rst @@ -0,0 +1,7 @@ +AuraGraphDataScience +-------------------- + +.. autoclass:: graphdatascience.session.AuraGraphDataScience + :members: + :exclude-members: __init__ + :inherited-members: diff --git a/doc/sphinx/source/sessions/index.rst b/doc/sphinx/source/sessions/index.rst new file mode 100644 index 000000000..c88f7d21a --- /dev/null +++ b/doc/sphinx/source/sessions/index.rst @@ -0,0 +1,15 @@ +.. toctree:: + :maxdepth: 1 + :caption: Contents + + gds_sessions + dbms_connection_info + session_memory + algorithm_category + cloud_location + aura_graphdatascience + +.. toctree:: + :hidden: + + session_v2_endpoints diff --git a/doc/sphinx/source/sessions/session_v2_endpoints.rst b/doc/sphinx/source/sessions/session_v2_endpoints.rst new file mode 100644 index 000000000..3f32a2f6c --- /dev/null +++ b/doc/sphinx/source/sessions/session_v2_endpoints.rst @@ -0,0 +1,7 @@ +AuraGraphDataScience +-------------------- + +.. autoclass:: graphdatascience.session.session_v2_endpoints.SessionV2Endpoints + :members: + :exclude-members: __init__, set_progress + :inherited-members: diff --git a/doc/sphinx/source/v2_endpoints/catalog_arrow_endpoints.rst b/doc/sphinx/source/v2_endpoints/catalog_arrow_endpoints.rst new file mode 100644 index 000000000..b69fab5f3 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/catalog_arrow_endpoints.rst @@ -0,0 +1,6 @@ +Catalog Arrow Endpoints +======================== + +.. automodule:: graphdatascience.procedure_surface.arrow.catalog + :exclude-members: __init__ + :members: diff --git a/doc/sphinx/source/v2_endpoints/catalog_endpoints.rst b/doc/sphinx/source/v2_endpoints/catalog_endpoints.rst new file mode 100644 index 000000000..a9d0eee60 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/catalog_endpoints.rst @@ -0,0 +1,6 @@ +Catalog Arrow Endpoints +======================== + +.. automodule:: graphdatascience.procedure_surface.api.catalog + :exclude-members: __init__ + :members: diff --git a/doc/sphinx/source/v2_endpoints/centrality_endpoints.rst b/doc/sphinx/source/v2_endpoints/centrality_endpoints.rst new file mode 100644 index 000000000..d68979b0a --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/centrality_endpoints.rst @@ -0,0 +1,6 @@ +Centrality Algorithms +======================= + +.. automodule:: graphdatascience.procedure_surface.api.centrality + :members: + :exclude-members: __init__ diff --git a/doc/sphinx/source/v2_endpoints/community_endpoints.rst b/doc/sphinx/source/v2_endpoints/community_endpoints.rst new file mode 100644 index 000000000..01cddd1af --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/community_endpoints.rst @@ -0,0 +1,6 @@ +Community Algorithms +==================== + +.. automodule:: graphdatascience.procedure_surface.api.community + :members: + :exclude-members: __init__ diff --git a/doc/sphinx/source/v2_endpoints/estimation_result.rst b/doc/sphinx/source/v2_endpoints/estimation_result.rst new file mode 100644 index 000000000..cc0abd35c --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/estimation_result.rst @@ -0,0 +1,6 @@ +Estimation Result +================= + +.. automodule:: graphdatascience.procedure_surface.api.estimation_result + :members: + \ No newline at end of file diff --git a/doc/sphinx/source/v2_endpoints/index.rst b/doc/sphinx/source/v2_endpoints/index.rst new file mode 100644 index 000000000..be3b7f161 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/index.rst @@ -0,0 +1,11 @@ +.. toctree:: + :hidden: + + catalog_endpoints + catalog_arrow_endpoints + centrality_endpoints + community_endpoints + node_embedding_endpoints + pathfinding_endpoints + similarity_endpoints + estimation_result diff --git a/doc/sphinx/source/v2_endpoints/node_embedding_endpoints.rst b/doc/sphinx/source/v2_endpoints/node_embedding_endpoints.rst new file mode 100644 index 000000000..39633c044 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/node_embedding_endpoints.rst @@ -0,0 +1,6 @@ +Node Embedding Algorithms +========================== + +.. automodule:: graphdatascience.procedure_surface.api.node_embedding + :members: + :exclude-members: __init__ diff --git a/doc/sphinx/source/v2_endpoints/pathfinding_endpoints.rst b/doc/sphinx/source/v2_endpoints/pathfinding_endpoints.rst new file mode 100644 index 000000000..419a93852 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/pathfinding_endpoints.rst @@ -0,0 +1,6 @@ +Pathfinding Algorithms +======================= + +.. automodule:: graphdatascience.procedure_surface.api.pathfinding + :members: + :exclude-members: __init__ diff --git a/doc/sphinx/source/v2_endpoints/similarity_endpoints.rst b/doc/sphinx/source/v2_endpoints/similarity_endpoints.rst new file mode 100644 index 000000000..8d5c83fb4 --- /dev/null +++ b/doc/sphinx/source/v2_endpoints/similarity_endpoints.rst @@ -0,0 +1,6 @@ +Similarity Algorithms +====================== + +.. automodule:: graphdatascience.procedure_surface.api.similarity + :members: + :exclude-members: __init__ diff --git a/graphdatascience/procedure_surface/api/__init__.py b/graphdatascience/procedure_surface/api/__init__.py index e69de29bb..dcc0c93fe 100644 --- a/graphdatascience/procedure_surface/api/__init__.py +++ b/graphdatascience/procedure_surface/api/__init__.py @@ -0,0 +1,3 @@ +from graphdatascience.procedure_surface.api.estimation_result import EstimationResult + +__all__ = ["EstimationResult"] diff --git a/graphdatascience/procedure_surface/api/catalog/__init__.py b/graphdatascience/procedure_surface/api/catalog/__init__.py index e69de29bb..2cc1f0aca 100644 --- a/graphdatascience/procedure_surface/api/catalog/__init__.py +++ b/graphdatascience/procedure_surface/api/catalog/__init__.py @@ -0,0 +1,77 @@ +from graphdatascience.procedure_surface.api.catalog.catalog_endpoints import ( + CatalogEndpoints, + GraphFilterResult, + GraphGenerationStats, + GraphWithFilterResult, + GraphWithGenerationStats, + RelationshipPropertySpec, +) +from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2 +from graphdatascience.procedure_surface.api.catalog.graph_backend import GraphBackend +from graphdatascience.procedure_surface.api.catalog.graph_info import GraphInfo +from graphdatascience.procedure_surface.api.catalog.graph_sampling_endpoints import ( + GraphSamplingEndpoints, + GraphSamplingResult, + GraphWithSamplingResult, +) +from graphdatascience.procedure_surface.api.catalog.node_label_endpoints import ( + NodeLabelEndpoints, + NodeLabelMutateResult, + NodeLabelPersistenceResult, + NodeLabelWriteResult, +) +from graphdatascience.procedure_surface.api.catalog.node_properties_endpoints import ( + NodePropertiesDropResult, + NodePropertiesEndpoints, + NodePropertiesWriteResult, + NodePropertySpec, +) +from graphdatascience.procedure_surface.api.catalog.relationships_endpoints import ( + Aggregation, + RelationshipsDropResult, + RelationshipsEndpoints, + RelationshipsInverseIndexResult, + RelationshipsToUndirectedResult, + RelationshipsWriteResult, +) +from graphdatascience.procedure_surface.api.catalog.scale_properties_endpoints import ( + ScalePropertiesEndpoints, + ScalePropertiesMutateResult, + ScalePropertiesStatsResult, + ScalePropertiesWriteResult, +) +from graphdatascience.procedure_surface.api.catalog.scaler_config import ScalerConfig + +__all__ = [ + "Aggregation", + "CatalogEndpoints", + "GraphBackend", + "GraphFilterResult", + "GraphGenerationStats", + "GraphInfo", + "GraphSamplingEndpoints", + "GraphSamplingResult", + "GraphV2", + "GraphWithFilterResult", + "GraphWithGenerationStats", + "GraphWithSamplingResult", + "NodeLabelEndpoints", + "NodeLabelMutateResult", + "NodeLabelPersistenceResult", + "NodeLabelWriteResult", + "NodePropertiesDropResult", + "NodePropertiesEndpoints", + "NodePropertiesWriteResult", + "NodePropertySpec", + "RelationshipPropertySpec", + "RelationshipsDropResult", + "RelationshipsEndpoints", + "RelationshipsInverseIndexResult", + "RelationshipsToUndirectedResult", + "RelationshipsWriteResult", + "ScalePropertiesEndpoints", + "ScalePropertiesMutateResult", + "ScalePropertiesStatsResult", + "ScalePropertiesWriteResult", + "ScalerConfig", +] diff --git a/graphdatascience/procedure_surface/api/catalog/scaler_config.py b/graphdatascience/procedure_surface/api/catalog/scaler_config.py index 3b8b9f33d..ad6744ba8 100644 --- a/graphdatascience/procedure_surface/api/catalog/scaler_config.py +++ b/graphdatascience/procedure_surface/api/catalog/scaler_config.py @@ -1,17 +1,10 @@ -from pydantic import BaseModel +from pydantic import BaseModel, Field class ScalerConfig(BaseModel): - """ - Configuration for a scaler used in the Scale Properties algorithm. - - Attributes - ---------- - type : str - The type of scaler to use. Can be 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center'. - offset : int | float - The offset to add to the property values before applying the log transformation. Only used when type is 'Log'. - """ - - type: str - offset: int | float | None = None + type: str = Field( + description="The type of scaler to use. Can be 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center'." + ) + offset: int | float | None = Field( + description="The offset to add to the property values before applying the log transformation. Only used when type is 'Log'." + ) diff --git a/graphdatascience/procedure_surface/api/centrality/__init__.py b/graphdatascience/procedure_surface/api/centrality/__init__.py index e69de29bb..123c34ff5 100644 --- a/graphdatascience/procedure_surface/api/centrality/__init__.py +++ b/graphdatascience/procedure_surface/api/centrality/__init__.py @@ -0,0 +1,93 @@ +from graphdatascience.procedure_surface.api.centrality.articlerank_endpoints import ( + ArticleRankEndpoints, + ArticleRankMutateResult, + ArticleRankStatsResult, + ArticleRankWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.articulationpoints_endpoints import ( + ArticulationPointsEndpoints, + ArticulationPointsMutateResult, + ArticulationPointsStatsResult, + ArticulationPointsWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.betweenness_endpoints import ( + BetweennessEndpoints, + BetweennessMutateResult, + BetweennessStatsResult, + BetweennessWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.celf_endpoints import ( + CelfEndpoints, + CelfMutateResult, + CelfStatsResult, + CelfWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.closeness_endpoints import ( + ClosenessEndpoints, + ClosenessMutateResult, + ClosenessStatsResult, + ClosenessWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.closeness_harmonic_endpoints import ( + ClosenessHarmonicEndpoints, + ClosenessHarmonicMutateResult, + ClosenessHarmonicStatsResult, + ClosenessHarmonicWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.degree_endpoints import ( + DegreeEndpoints, + DegreeMutateResult, + DegreeStatsResult, + DegreeWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.eigenvector_endpoints import ( + EigenvectorEndpoints, + EigenvectorMutateResult, + EigenvectorStatsResult, + EigenvectorWriteResult, +) +from graphdatascience.procedure_surface.api.centrality.pagerank_endpoints import ( + PageRankEndpoints, + PageRankMutateResult, + PageRankStatsResult, + PageRankWriteResult, +) + +__all__ = [ + "ArticleRankEndpoints", + "ArticleRankMutateResult", + "ArticleRankStatsResult", + "ArticleRankWriteResult", + "ArticulationPointsEndpoints", + "ArticulationPointsMutateResult", + "ArticulationPointsStatsResult", + "ArticulationPointsWriteResult", + "BetweennessEndpoints", + "BetweennessMutateResult", + "BetweennessStatsResult", + "BetweennessWriteResult", + "CelfEndpoints", + "CelfMutateResult", + "CelfStatsResult", + "CelfWriteResult", + "ClosenessEndpoints", + "ClosenessHarmonicEndpoints", + "ClosenessHarmonicMutateResult", + "ClosenessHarmonicStatsResult", + "ClosenessHarmonicWriteResult", + "ClosenessMutateResult", + "ClosenessStatsResult", + "ClosenessWriteResult", + "DegreeEndpoints", + "DegreeMutateResult", + "DegreeStatsResult", + "DegreeWriteResult", + "EigenvectorEndpoints", + "EigenvectorMutateResult", + "EigenvectorStatsResult", + "EigenvectorWriteResult", + "PageRankEndpoints", + "PageRankMutateResult", + "PageRankStatsResult", + "PageRankWriteResult", +] diff --git a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py index afc3d23d5..10039b496 100644 --- a/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py @@ -280,7 +280,7 @@ def write( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) diff --git a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py index 149ae53b4..c4d6c2ca7 100644 --- a/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +++ b/graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py @@ -141,8 +141,9 @@ def stats( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None node ids to use as starting points. Can be: + - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) - list of tuples to associate each node with a bias > 0 (e.g., [(42, 0.5), (43, 1.0)]) @@ -151,6 +152,7 @@ def stats( ------- PageRankStatsResult Algorithm statistics + """ pass @@ -277,7 +279,7 @@ def write( Identifier for the job. relationship_weight_property : str | None, default=None Name of the property to be used as weights. - source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None + source_nodes : int | list[int] | list[tuple[int, float]] | None, default=None node ids to use as starting points. Can be: - single node id (e.g., 42) - list of node id (e.g., [42, 43, 44]) diff --git a/graphdatascience/procedure_surface/api/community/__init__.py b/graphdatascience/procedure_surface/api/community/__init__.py index e69de29bb..af33e122a 100644 --- a/graphdatascience/procedure_surface/api/community/__init__.py +++ b/graphdatascience/procedure_surface/api/community/__init__.py @@ -0,0 +1,146 @@ +from graphdatascience.procedure_surface.api.community.clique_counting_endpoints import ( + CliqueCountingEndpoints, + CliqueCountingMutateResult, + CliqueCountingStatsResult, + CliqueCountingWriteResult, +) +from graphdatascience.procedure_surface.api.community.hdbscan_endpoints import ( + HdbscanEndpoints, + HdbscanMutateResult, + HdbscanStatsResult, + HdbscanWriteResult, +) +from graphdatascience.procedure_surface.api.community.k1coloring_endpoints import ( + K1ColoringEndpoints, + K1ColoringMutateResult, + K1ColoringStatsResult, + K1ColoringWriteResult, +) +from graphdatascience.procedure_surface.api.community.kcore_endpoints import ( + KCoreEndpoints, + KCoreMutateResult, + KCoreStatsResult, + KCoreWriteResult, +) +from graphdatascience.procedure_surface.api.community.kmeans_endpoints import ( + KMeansEndpoints, + KMeansMutateResult, + KMeansStatsResult, + KMeansWriteResult, +) +from graphdatascience.procedure_surface.api.community.labelpropagation_endpoints import ( + LabelPropagationEndpoints, + LabelPropagationMutateResult, + LabelPropagationStatsResult, + LabelPropagationWriteResult, +) +from graphdatascience.procedure_surface.api.community.leiden_endpoints import ( + LeidenEndpoints, + LeidenMutateResult, + LeidenStatsResult, + LeidenWriteResult, +) +from graphdatascience.procedure_surface.api.community.local_clustering_coefficient_endpoints import ( + LocalClusteringCoefficientEndpoints, + LocalClusteringCoefficientMutateResult, + LocalClusteringCoefficientStatsResult, + LocalClusteringCoefficientWriteResult, +) +from graphdatascience.procedure_surface.api.community.louvain_endpoints import ( + LouvainEndpoints, + LouvainMutateResult, + LouvainStatsResult, + LouvainWriteResult, +) +from graphdatascience.procedure_surface.api.community.maxkcut_endpoints import MaxKCutEndpoints, MaxKCutMutateResult +from graphdatascience.procedure_surface.api.community.modularity_optimization_endpoints import ( + ModularityOptimizationEndpoints, + ModularityOptimizationMutateResult, + ModularityOptimizationStatsResult, + ModularityOptimizationWriteResult, +) +from graphdatascience.procedure_surface.api.community.scc_endpoints import ( + SccEndpoints, + SccMutateResult, + SccStatsResult, + SccWriteResult, +) +from graphdatascience.procedure_surface.api.community.sllpa_endpoints import ( + SllpaEndpoints, + SllpaMutateResult, + SllpaStatsResult, + SllpaWriteResult, +) +from graphdatascience.procedure_surface.api.community.triangle_count_endpoints import ( + TriangleCountEndpoints, + TriangleCountMutateResult, + TriangleCountStatsResult, + TriangleCountWriteResult, +) +from graphdatascience.procedure_surface.api.community.wcc_endpoints import ( + WccEndpoints, + WccMutateResult, + WccStatsResult, + WccWriteResult, +) + +__all__ = [ + "CliqueCountingEndpoints", + "CliqueCountingMutateResult", + "CliqueCountingStatsResult", + "CliqueCountingWriteResult", + "HdbscanEndpoints", + "HdbscanMutateResult", + "HdbscanStatsResult", + "HdbscanWriteResult", + "K1ColoringEndpoints", + "K1ColoringMutateResult", + "K1ColoringStatsResult", + "K1ColoringWriteResult", + "KCoreEndpoints", + "KCoreMutateResult", + "KCoreStatsResult", + "KCoreWriteResult", + "KMeansEndpoints", + "KMeansMutateResult", + "KMeansStatsResult", + "KMeansWriteResult", + "LabelPropagationEndpoints", + "LabelPropagationMutateResult", + "LabelPropagationStatsResult", + "LabelPropagationWriteResult", + "LeidenEndpoints", + "LeidenMutateResult", + "LeidenStatsResult", + "LeidenWriteResult", + "LocalClusteringCoefficientEndpoints", + "LocalClusteringCoefficientMutateResult", + "LocalClusteringCoefficientStatsResult", + "LocalClusteringCoefficientWriteResult", + "LouvainEndpoints", + "LouvainMutateResult", + "LouvainStatsResult", + "LouvainWriteResult", + "MaxKCutEndpoints", + "MaxKCutMutateResult", + "ModularityOptimizationEndpoints", + "ModularityOptimizationMutateResult", + "ModularityOptimizationStatsResult", + "ModularityOptimizationWriteResult", + "SccEndpoints", + "SccMutateResult", + "SccStatsResult", + "SccWriteResult", + "SllpaEndpoints", + "SllpaMutateResult", + "SllpaStatsResult", + "SllpaWriteResult", + "TriangleCountEndpoints", + "TriangleCountMutateResult", + "TriangleCountStatsResult", + "TriangleCountWriteResult", + "WccEndpoints", + "WccMutateResult", + "WccStatsResult", + "WccWriteResult", +] diff --git a/graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py b/graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py index 05b67905d..d75eb925b 100644 --- a/graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py @@ -197,27 +197,6 @@ def estimate( class MaxKCutMutateResult(BaseResult): - """ - Result object returned by the Approximate Maximum k-cut mutate operation. - - Attributes - ---------- - cut_cost : float - The cost of the cut, representing the sum of weights of edges between different communities - compute_millis : int - Time spent on computation in milliseconds - configuration : dict[str, Any] - The configuration used for the algorithm execution - mutate_millis : int - Time spent on mutating the graph in milliseconds - node_properties_written : int - The number of node properties written to the graph - post_processing_millis : int - Time spent on post-processing in milliseconds - pre_processing_millis : int - Time spent on pre-processing in milliseconds - """ - cut_cost: float compute_millis: int configuration: dict[str, Any] diff --git a/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py b/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py index 315ca0d9c..868b42a9b 100644 --- a/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/sllpa_endpoints.py @@ -258,27 +258,6 @@ def estimate( class SllpaMutateResult(BaseResult): - """ - Represents the result of the Speaker-Listener Label Propagation algorithm (SLLPA) mutate operation. - - Attributes - ---------- - ran_iterations : int - The number of iterations the algorithm ran - did_converge : bool - Whether the algorithm converged - pre_processing_millis : int - Time spent preprocessing in milliseconds - compute_millis : int - Time spent computing in milliseconds - mutate_millis : int - Time spent writing results to the graph in milliseconds - node_properties_written : int - The number of node properties written - configuration : dict - The configuration used for the algorithm - """ - ran_iterations: int did_converge: bool pre_processing_millis: int @@ -289,23 +268,6 @@ class SllpaMutateResult(BaseResult): class SllpaStatsResult(BaseResult): - """ - Represents the result of the Speaker-Listener Label Propagation algorithm (SLLPA) stats operation. - - Attributes - ---------- - ran_iterations : int - The number of iterations the algorithm ran - did_converge : bool - Whether the algorithm converged - pre_processing_millis : int - Time spent preprocessing in milliseconds - compute_millis : int - Time spent computing in milliseconds - configuration : dict - The configuration used for the algorithm - """ - ran_iterations: int did_converge: bool pre_processing_millis: int @@ -314,27 +276,6 @@ class SllpaStatsResult(BaseResult): class SllpaWriteResult(BaseResult): - """ - Represents the result of the Speaker-Listener Label Propagation algorithm (SLLPA) write operation. - - Attributes - ---------- - ran_iterations : int - The number of iterations the algorithm ran - did_converge : bool - Whether the algorithm converged - pre_processing_millis : int - Time spent preprocessing in milliseconds - compute_millis : int - Time spent computing in milliseconds - write_millis : int - Time spent writing results to the database in milliseconds - node_properties_written : int - The number of node properties written - configuration : dict - The configuration used for the algorithm - """ - ran_iterations: int did_converge: bool pre_processing_millis: int diff --git a/graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py b/graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py index fcd627cfa..7f17c19ff 100644 --- a/graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py +++ b/graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py @@ -281,29 +281,6 @@ def estimate( class TriangleCountMutateResult(BaseResult): - """ - Result object returned by the Triangle Count mutate operation. - - Attributes - ---------- - compute_millis : int - Time spent on computation in milliseconds - configuration : dict[str, Any] - The configuration used for the algorithm execution - global_triangle_count : int - The total number of triangles in the graph - mutate_millis : int - Time spent on mutating the graph in milliseconds - node_count : int - The total number of nodes processed - node_properties_written : int - The number of node properties written to the graph - post_processing_millis : int - Time spent on post-processing in milliseconds - pre_processing_millis : int - Time spent on pre-processing in milliseconds - """ - compute_millis: int configuration: dict[str, Any] global_triangle_count: int @@ -315,25 +292,6 @@ class TriangleCountMutateResult(BaseResult): class TriangleCountStatsResult(BaseResult): - """ - Result object returned by the Triangle Count stats operation. - - Attributes - ---------- - compute_millis : int - Time spent on computation in milliseconds - configuration : dict[str, Any] - The configuration used for the algorithm execution - global_triangle_count : int - The total number of triangles in the graph - node_count : int - The total number of nodes processed - post_processing_millis : int - Time spent on post-processing in milliseconds - pre_processing_millis : int - Time spent on pre-processing in milliseconds - """ - compute_millis: int configuration: dict[str, Any] global_triangle_count: int @@ -343,29 +301,6 @@ class TriangleCountStatsResult(BaseResult): class TriangleCountWriteResult(BaseResult): - """ - Result object returned by the Triangle Count write operation. - - Attributes - ---------- - compute_millis : int - Time spent on computation in milliseconds - configuration : dict[str, Any] - The configuration used for the algorithm execution - global_triangle_count : int - The total number of triangles in the graph - node_count : int - The total number of nodes processed - node_properties_written : int - The number of node properties written to the database - post_processing_millis : int - Time spent on post-processing in milliseconds - pre_processing_millis : int - Time spent on pre-processing in milliseconds - write_millis : int - Time spent on writing results to the database in milliseconds - """ - compute_millis: int configuration: dict[str, Any] global_triangle_count: int diff --git a/graphdatascience/procedure_surface/api/node_embedding/__init__.py b/graphdatascience/procedure_surface/api/node_embedding/__init__.py index e69de29bb..5523be889 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/__init__.py +++ b/graphdatascience/procedure_surface/api/node_embedding/__init__.py @@ -0,0 +1,45 @@ +from graphdatascience.procedure_surface.api.node_embedding.fastrp_endpoints import ( + FastRPEndpoints, + FastRPMutateResult, + FastRPStatsResult, + FastRPWriteResult, +) +from graphdatascience.procedure_surface.api.node_embedding.graphsage_endpoints import GraphSageEndpoints +from graphdatascience.procedure_surface.api.node_embedding.graphsage_predict_endpoints import ( + GraphSagePredictEndpoints, + GraphSageMutateResult, + GraphSageWriteResult, +) +from graphdatascience.procedure_surface.api.node_embedding.graphsage_train_endpoints import ( + GraphSageTrainEndpoints, + GraphSageTrainResult, +) +from graphdatascience.procedure_surface.api.node_embedding.hashgnn_endpoints import ( + HashGNNEndpoints, + HashGNNMutateResult, + HashGNNWriteResult, +) +from graphdatascience.procedure_surface.api.node_embedding.node2vec_endpoints import ( + Node2VecEndpoints, + Node2VecMutateResult, + Node2VecWriteResult, +) + +__all__ = [ + "FastRPEndpoints", + "FastRPMutateResult", + "FastRPStatsResult", + "FastRPWriteResult", + "GraphSageEndpoints", + "GraphSageMutateResult", + "GraphSagePredictEndpoints", + "GraphSageTrainEndpoints", + "GraphSageTrainResult", + "GraphSageWriteResult", + "HashGNNEndpoints", + "HashGNNMutateResult", + "HashGNNWriteResult", + "Node2VecEndpoints", + "Node2VecMutateResult", + "Node2VecWriteResult", +] diff --git a/graphdatascience/procedure_surface/api/pathfinding/__init__.py b/graphdatascience/procedure_surface/api/pathfinding/__init__.py index e69de29bb..eaabe62c2 100644 --- a/graphdatascience/procedure_surface/api/pathfinding/__init__.py +++ b/graphdatascience/procedure_surface/api/pathfinding/__init__.py @@ -0,0 +1,101 @@ +from graphdatascience.procedure_surface.api.pathfinding.all_shortest_path_endpoints import AllShortestPathEndpoints +from graphdatascience.procedure_surface.api.pathfinding.dijkstra_endpoints import ( + DijkstraEndpoints, + DijkstraMutateResult, + DijkstraStreamResult, + DijkstraWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.k_spanning_tree_endpoints import ( + KSpanningTreeEndpoints, + KSpanningTreeWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.prize_steiner_tree_endpoints import ( + PrizeSteinerTreeEndpoints, + PrizeSteinerTreeMutateResult, + PrizeSteinerTreeStatsResult, + PrizeSteinerTreeWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.shortest_path_endpoints import ShortestPathEndpoints +from graphdatascience.procedure_surface.api.pathfinding.single_source_bellman_ford_endpoints import ( + BellmanFordMutateResult, + BellmanFordStatsResult, + BellmanFordWriteResult, + SingleSourceBellmanFordEndpoints, +) +from graphdatascience.procedure_surface.api.pathfinding.single_source_delta_endpoints import ( + DeltaSteppingMutateResult, + DeltaSteppingStatsResult, + DeltaSteppingWriteResult, + SingleSourceDeltaEndpoints, +) +from graphdatascience.procedure_surface.api.pathfinding.single_source_dijkstra_endpoints import ( + SingleSourceDijkstraEndpoints, + SingleSourceDijkstraMutateResult, + SingleSourceDijkstraWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.source_target_astar_endpoints import ( + AStarMutateResult, + AStarWriteResult, + SourceTargetAStarEndpoints, +) +from graphdatascience.procedure_surface.api.pathfinding.source_target_dijkstra_endpoints import ( + SourceTargetDijkstraEndpoints, +) +from graphdatascience.procedure_surface.api.pathfinding.source_target_yens_endpoints import ( + SourceTargetYensEndpoints, + YensMutateResult, + YensWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.spanning_tree_endpoints import ( + SpanningTreeEndpoints, + SpanningTreeMutateResult, + SpanningTreeStatsResult, + SpanningTreeWriteResult, +) +from graphdatascience.procedure_surface.api.pathfinding.steiner_tree_endpoints import ( + SteinerTreeEndpoints, + SteinerTreeMutateResult, + SteinerTreeStatsResult, + SteinerTreeWriteResult, +) + +__all__ = [ + "AllShortestPathEndpoints", + "AStarMutateResult", + "AStarWriteResult", + "BellmanFordMutateResult", + "BellmanFordStatsResult", + "BellmanFordWriteResult", + "DeltaSteppingMutateResult", + "DeltaSteppingStatsResult", + "DeltaSteppingWriteResult", + "DijkstraEndpoints", + "DijkstraMutateResult", + "DijkstraStreamResult", + "DijkstraWriteResult", + "KSpanningTreeEndpoints", + "KSpanningTreeWriteResult", + "PrizeSteinerTreeEndpoints", + "PrizeSteinerTreeMutateResult", + "PrizeSteinerTreeStatsResult", + "PrizeSteinerTreeWriteResult", + "ShortestPathEndpoints", + "SingleSourceBellmanFordEndpoints", + "SingleSourceDeltaEndpoints", + "SingleSourceDijkstraEndpoints", + "SingleSourceDijkstraMutateResult", + "SingleSourceDijkstraWriteResult", + "SourceTargetAStarEndpoints", + "SourceTargetDijkstraEndpoints", + "SourceTargetYensEndpoints", + "SpanningTreeEndpoints", + "SpanningTreeMutateResult", + "SpanningTreeStatsResult", + "SpanningTreeWriteResult", + "SteinerTreeEndpoints", + "SteinerTreeMutateResult", + "SteinerTreeStatsResult", + "SteinerTreeWriteResult", + "YensMutateResult", + "YensWriteResult", +] diff --git a/graphdatascience/procedure_surface/api/similarity/__init__.py b/graphdatascience/procedure_surface/api/similarity/__init__.py index e69de29bb..017b1dbf5 100644 --- a/graphdatascience/procedure_surface/api/similarity/__init__.py +++ b/graphdatascience/procedure_surface/api/similarity/__init__.py @@ -0,0 +1,29 @@ +from graphdatascience.procedure_surface.api.similarity.knn_endpoints import KnnEndpoints +from graphdatascience.procedure_surface.api.similarity.knn_filtered_endpoints import KnnFilteredEndpoints +from graphdatascience.procedure_surface.api.similarity.knn_results import ( + KnnMutateResult, + KnnStatsResult, + KnnWriteResult, +) +from graphdatascience.procedure_surface.api.similarity.node_similarity_endpoints import NodeSimilarityEndpoints +from graphdatascience.procedure_surface.api.similarity.node_similarity_filtered_endpoints import ( + NodeSimilarityFilteredEndpoints, +) +from graphdatascience.procedure_surface.api.similarity.node_similarity_results import ( + NodeSimilarityMutateResult, + NodeSimilarityStatsResult, + NodeSimilarityWriteResult, +) + +__all__ = [ + "KnnEndpoints", + "KnnFilteredEndpoints", + "KnnMutateResult", + "KnnStatsResult", + "KnnWriteResult", + "NodeSimilarityEndpoints", + "NodeSimilarityFilteredEndpoints", + "NodeSimilarityMutateResult", + "NodeSimilarityStatsResult", + "NodeSimilarityWriteResult", +] diff --git a/graphdatascience/procedure_surface/arrow/catalog/__init__.py b/graphdatascience/procedure_surface/arrow/catalog/__init__.py index e69de29bb..4db1a05cb 100644 --- a/graphdatascience/procedure_surface/arrow/catalog/__init__.py +++ b/graphdatascience/procedure_surface/arrow/catalog/__init__.py @@ -0,0 +1,3 @@ +from .catalog_arrow_endpoints import CatalogArrowEndpoints, GraphWithProjectResult, ProjectionResult + +__all__ = ["CatalogArrowEndpoints", "GraphWithProjectResult", "ProjectionResult"] diff --git a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py b/graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py similarity index 97% rename from graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py rename to graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py index f25f5bddc..4eece9ca0 100644 --- a/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py +++ b/graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py @@ -250,6 +250,8 @@ def _arrow_config(self) -> dict[str, Any]: class ProjectionResult(BaseResult): + """Result object for graph projection jobs.""" + graph_name: str node_count: int relationship_count: int @@ -259,6 +261,9 @@ class ProjectionResult(BaseResult): class GraphWithProjectResult(NamedTuple): + """Result object for graph projection jobs, containing the projected graph and the projection result. + Can be used as a context manager to ensure the projected graph is dropped after use.""" + graph: GraphV2 result: ProjectionResult diff --git a/graphdatascience/session/__init__.py b/graphdatascience/session/__init__.py index fd20e266e..ee8a72cde 100644 --- a/graphdatascience/session/__init__.py +++ b/graphdatascience/session/__init__.py @@ -5,6 +5,7 @@ from .gds_sessions import AuraAPICredentials, GdsSessions from .session_info import SessionInfo from .session_sizes import SessionMemory, SessionMemoryValue +from .aura_graph_data_science import AuraGraphDataScience __all__ = [ "GdsSessions", @@ -17,4 +18,5 @@ "AlgorithmCategory", "SessionStatusError", "AuraApiError", + "AuraGraphDataScience", ] diff --git a/graphdatascience/session/aura_graph_data_science.py b/graphdatascience/session/aura_graph_data_science.py index 31270fc80..66468585c 100644 --- a/graphdatascience/session/aura_graph_data_science.py +++ b/graphdatascience/session/aura_graph_data_science.py @@ -173,6 +173,10 @@ def beta(self) -> BetaEndpoints: @property def v2(self) -> SessionV2Endpoints: + """ + Return preview v2 endpoints. These endpoints may change without warning. + These endpoints are a preview of the API for the next major version of this library. + """ return self._v2_endpoints def __getattr__(self, attr: str) -> IndirectCallBuilder: diff --git a/graphdatascience/session/session_v2_endpoints.py b/graphdatascience/session/session_v2_endpoints.py index 70a55b290..07c5f6e14 100644 --- a/graphdatascience/session/session_v2_endpoints.py +++ b/graphdatascience/session/session_v2_endpoints.py @@ -47,7 +47,7 @@ from graphdatascience.procedure_surface.arrow.catalog.scale_properties_arrow_endpoints import ( ScalePropertiesArrowEndpoints, ) -from graphdatascience.procedure_surface.arrow.catalog_arrow_endpoints import CatalogArrowEndpoints +from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints from graphdatascience.procedure_surface.arrow.centrality.articlerank_arrow_endpoints import ArticleRankArrowEndpoints from graphdatascience.procedure_surface.arrow.centrality.articulationpoints_arrow_endpoints import ( ArticulationPointsArrowEndpoints, @@ -141,58 +141,94 @@ def set_show_progress(self, show_progress: bool) -> None: @property def graph(self) -> CatalogArrowEndpoints: + """ + Return graph-related endpoints for graph management. + """ return CatalogArrowEndpoints(self._arrow_client, self._db_client, show_progress=self._show_progress) ## Algorithms @property def all_shortest_paths(self) -> AllShortestPathEndpoints: + """ + Return endpoints for the all shortest paths algorithm. + """ return AllShortestPathArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def article_rank(self) -> ArticleRankEndpoints: + """ + Return endpoints for the article rank algorithm. + """ return ArticleRankArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def articulation_points(self) -> ArticulationPointsEndpoints: + """ + Return endpoints for the articulation points algorithm. + """ return ArticulationPointsArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def betweenness_centrality(self) -> BetweennessEndpoints: + """ + Return endpoints for the betweenness centrality algorithm. + """ return BetweennessArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def bellman_ford(self) -> SingleSourceBellmanFordEndpoints: + """ + Return endpoints for the single source Bellman-Ford algorithm. + """ return BellmanFordArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def clique_counting(self) -> CliqueCountingEndpoints: + """ + Return endpoints for the clique counting algorithm. + """ return CliqueCountingArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def closeness_centrality(self) -> ClosenessEndpoints: + """ + Return endpoints for the closeness centrality algorithm. + """ return ClosenessArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def degree_centrality(self) -> DegreeEndpoints: + """ + Return endpoints for the degree centrality algorithm. + """ return DegreeArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def eigenvector_centrality(self) -> EigenvectorEndpoints: + """ + Return endpoints for the eigenvector centrality algorithm. + """ return EigenvectorArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def fast_rp(self) -> FastRPEndpoints: + """ + Return endpoints for the fast RP algorithm. + """ return FastRPArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def graph_sage(self) -> GraphSageEndpoints: + """ + Return endpoints for the GraphSage algorithm. + """ return GraphSageEndpoints( train_endpoints=GraphSageTrainArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress @@ -204,130 +240,211 @@ def graph_sage(self) -> GraphSageEndpoints: @property def harmonic_centrality(self) -> ClosenessHarmonicEndpoints: + """ + Return endpoints for the harmonic centrality algorithm. + """ return ClosenessHarmonicArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def hash_gnn(self) -> HashGNNEndpoints: + """ + Return endpoints for the HashGNN algorithm. + """ return HashGNNArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def hdbscan(self) -> HdbscanEndpoints: + """ + Return endpoints for the HDBSCAN algorithm. + """ return HdbscanArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def influence_maximization_celf(self) -> CelfEndpoints: + """ + Return endpoints for the influence maximization CELF algorithm. + """ return CelfArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def k1_coloring(self) -> K1ColoringEndpoints: + """ + Return endpoints for the K1 coloring algorithm. + """ return K1ColoringArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def k_core_decomposition(self) -> KCoreEndpoints: + """ + Return endpoints for the K-core decomposition algorithm. + """ return KCoreArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def kmeans(self) -> KMeansEndpoints: + """ + Return endpoints for the K-means algorithm. + """ return KMeansArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def knn(self) -> KnnEndpoints: + """ + Return endpoints for the K-nearest neighbors algorithm. + """ return KnnArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def k_spanning_tree(self) -> KSpanningTreeEndpoints: + """ + Return endpoints for the K-spanning tree algorithm. + """ return KSpanningTreeArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def label_propagation(self) -> LabelPropagationEndpoints: + """ + Return endpoints for the label propagation algorithm. + """ return LabelPropagationArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def leiden(self) -> LeidenEndpoints: + """ + Return endpoints for the Leiden algorithm. + """ return LeidenArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def local_clustering_coefficient(self) -> LocalClusteringCoefficientEndpoints: + """ + Return endpoints for the local clustering coefficient algorithm. + """ return LocalClusteringCoefficientArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def louvain(self) -> LouvainEndpoints: + """ + Return endpoints for the Louvain algorithm. + """ return LouvainArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def max_k_cut(self) -> MaxKCutEndpoints: + """ + Return endpoints for the Max K-cut algorithm. + """ return MaxKCutArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def modularity_optimization(self) -> ModularityOptimizationEndpoints: + """ + Return endpoints for the modularity optimization algorithm. + """ return ModularityOptimizationArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def node2vec(self) -> Node2VecEndpoints: + """ + Return endpoints for the Node2Vec algorithm. + """ return Node2VecArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def node_similarity(self) -> NodeSimilarityEndpoints: + """ + Return endpoints for the node similarity algorithm. + """ return NodeSimilarityArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def page_rank(self) -> PageRankEndpoints: + """ + Return endpoints for the PageRank algorithm. + """ return PageRankArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def prize_steiner_tree(self) -> PrizeSteinerTreeEndpoints: + """ + Return endpoints for the prize-collecting Steiner tree algorithm. + """ return PrizeSteinerTreeArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def scc(self) -> SccEndpoints: + """ + Return endpoints for the strongly connected components algorithm. + """ return SccArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def scale_properties(self) -> ScalePropertiesEndpoints: + """ + Return endpoints for scaling node properties. + """ return ScalePropertiesArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def shortest_path(self) -> ShortestPathEndpoints: + """ + Return endpoints for the shortest path algorithm. + """ return ShortestPathArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def spanning_tree(self) -> SpanningTreeEndpoints: + """ + Return endpoints for the spanning tree algorithm. + """ return SpanningTreeArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def steiner_tree(self) -> SteinerTreeEndpoints: + """ + Return endpoints for the Steiner tree algorithm. + """ return SteinerTreeArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def sllpa(self) -> SllpaEndpoints: + """ + Return endpoints for the speaker-listener label propagation algorithm. + """ return SllpaArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) @property def triangle_count(self) -> TriangleCountEndpoints: + """ + Return endpoints for the triangle count algorithm. + """ return TriangleCountArrowEndpoints( self._arrow_client, self._write_back_client, show_progress=self._show_progress ) @property def wcc(self) -> WccEndpoints: + """ + Return endpoints for the weakly connected components algorithm. + """ return WccArrowEndpoints(self._arrow_client, self._write_back_client, show_progress=self._show_progress) diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/catalog/test_catalog_arrow_endpoints.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/catalog/test_catalog_arrow_endpoints.py index b181fad0b..db24bb7de 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/catalog/test_catalog_arrow_endpoints.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/catalog/test_catalog_arrow_endpoints.py @@ -8,7 +8,7 @@ from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient from graphdatascience.procedure_surface.api.catalog.catalog_endpoints import RelationshipPropertySpec from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2 -from graphdatascience.procedure_surface.arrow.catalog_arrow_endpoints import CatalogArrowEndpoints +from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints from graphdatascience.query_runner.query_runner import QueryRunner from graphdatascience.tests.integrationV2.procedure_surface.arrow.graph_creation_helper import create_graph diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py index e0833fcbd..e124c5dd4 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py @@ -7,7 +7,7 @@ from graphdatascience.arrow_client.v2.job_client import JobClient from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2 from graphdatascience.procedure_surface.arrow.catalog.graph_backend_arrow import get_graph -from graphdatascience.procedure_surface.arrow.catalog_arrow_endpoints import CatalogArrowEndpoints +from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints @contextmanager diff --git a/requirements/dev/dev.txt b/requirements/dev/dev.txt index 99a8c29cc..ee3f7005e 100644 --- a/requirements/dev/dev.txt +++ b/requirements/dev/dev.txt @@ -6,6 +6,7 @@ tox == 4.30.2 types-setuptools == 75.8.0.20250110 sphinx == 7.3.7 enum-tools[sphinx] == 0.12.0 +autodoc_pydantic types-requests types-tqdm types-python-dateutil From 5447658f8801c8466b8c8e47ca3522ff0834dcec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 19:54:08 +0100 Subject: [PATCH 8/9] Fix style + default for scaleProperties --- .../procedure_surface/api/catalog/scaler_config.py | 3 ++- .../procedure_surface/api/node_embedding/__init__.py | 2 +- graphdatascience/session/__init__.py | 2 +- graphdatascience/session/session_v2_endpoints.py | 2 +- .../procedure_surface/arrow/graph_creation_helper.py | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/graphdatascience/procedure_surface/api/catalog/scaler_config.py b/graphdatascience/procedure_surface/api/catalog/scaler_config.py index ad6744ba8..0fc1123b6 100644 --- a/graphdatascience/procedure_surface/api/catalog/scaler_config.py +++ b/graphdatascience/procedure_surface/api/catalog/scaler_config.py @@ -6,5 +6,6 @@ class ScalerConfig(BaseModel): description="The type of scaler to use. Can be 'MinMax', 'Mean', 'Max', 'Log', 'StdScore', 'Center'." ) offset: int | float | None = Field( - description="The offset to add to the property values before applying the log transformation. Only used when type is 'Log'." + default=None, + description="The offset to add to the property values before applying the log transformation. Only used when type is 'Log'.", ) diff --git a/graphdatascience/procedure_surface/api/node_embedding/__init__.py b/graphdatascience/procedure_surface/api/node_embedding/__init__.py index 5523be889..537e278f3 100644 --- a/graphdatascience/procedure_surface/api/node_embedding/__init__.py +++ b/graphdatascience/procedure_surface/api/node_embedding/__init__.py @@ -6,8 +6,8 @@ ) from graphdatascience.procedure_surface.api.node_embedding.graphsage_endpoints import GraphSageEndpoints from graphdatascience.procedure_surface.api.node_embedding.graphsage_predict_endpoints import ( - GraphSagePredictEndpoints, GraphSageMutateResult, + GraphSagePredictEndpoints, GraphSageWriteResult, ) from graphdatascience.procedure_surface.api.node_embedding.graphsage_train_endpoints import ( diff --git a/graphdatascience/session/__init__.py b/graphdatascience/session/__init__.py index ee8a72cde..dde0e2c78 100644 --- a/graphdatascience/session/__init__.py +++ b/graphdatascience/session/__init__.py @@ -1,11 +1,11 @@ from .algorithm_category import AlgorithmCategory from .aura_api import AuraApiError, SessionStatusError +from .aura_graph_data_science import AuraGraphDataScience from .cloud_location import CloudLocation from .dbms_connection_info import DbmsConnectionInfo from .gds_sessions import AuraAPICredentials, GdsSessions from .session_info import SessionInfo from .session_sizes import SessionMemory, SessionMemoryValue -from .aura_graph_data_science import AuraGraphDataScience __all__ = [ "GdsSessions", diff --git a/graphdatascience/session/session_v2_endpoints.py b/graphdatascience/session/session_v2_endpoints.py index 07c5f6e14..27efd9271 100644 --- a/graphdatascience/session/session_v2_endpoints.py +++ b/graphdatascience/session/session_v2_endpoints.py @@ -44,10 +44,10 @@ from graphdatascience.procedure_surface.api.pathfinding.steiner_tree_endpoints import SteinerTreeEndpoints from graphdatascience.procedure_surface.api.similarity.knn_endpoints import KnnEndpoints from graphdatascience.procedure_surface.api.similarity.node_similarity_endpoints import NodeSimilarityEndpoints +from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints from graphdatascience.procedure_surface.arrow.catalog.scale_properties_arrow_endpoints import ( ScalePropertiesArrowEndpoints, ) -from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints from graphdatascience.procedure_surface.arrow.centrality.articlerank_arrow_endpoints import ArticleRankArrowEndpoints from graphdatascience.procedure_surface.arrow.centrality.articulationpoints_arrow_endpoints import ( ArticulationPointsArrowEndpoints, diff --git a/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py b/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py index e124c5dd4..ca6272e15 100644 --- a/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py +++ b/graphdatascience/tests/integrationV2/procedure_surface/arrow/graph_creation_helper.py @@ -6,8 +6,8 @@ from graphdatascience.arrow_client.v2.data_mapper_utils import deserialize_single from graphdatascience.arrow_client.v2.job_client import JobClient from graphdatascience.procedure_surface.api.catalog.graph_api import GraphV2 -from graphdatascience.procedure_surface.arrow.catalog.graph_backend_arrow import get_graph from graphdatascience.procedure_surface.arrow.catalog.catalog_arrow_endpoints import CatalogArrowEndpoints +from graphdatascience.procedure_surface.arrow.catalog.graph_backend_arrow import get_graph @contextmanager From 919eacc54338ca07682449dd36d6d4955c6b539e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Mon, 10 Nov 2025 19:56:15 +0100 Subject: [PATCH 9/9] Fix dependencies for docs build --- requirements/dev/docs-ci.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements/dev/docs-ci.txt b/requirements/dev/docs-ci.txt index 9bc090653..9fb1d0a9f 100644 --- a/requirements/dev/docs-ci.txt +++ b/requirements/dev/docs-ci.txt @@ -1,4 +1,5 @@ sphinx == 7.2.6 enum-tools[sphinx] == 0.12.0 +autodoc_pydantic --r ../base/base.txt \ No newline at end of file +-r ../base/base.txt