graphdatascience 1.11a2__tar.gz → 1.11a3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {graphdatascience-1.11a2/graphdatascience.egg-info → graphdatascience-1.11a3}/PKG-INFO +3 -2
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/base_graph_proc_runner.py +3 -3
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_entity_ops_runner.py +12 -7
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_remote_project_runner.py +6 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/aura_db_query_runner.py +20 -74
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/gds_arrow_client.py +16 -4
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/__init__.py +2 -3
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aura_api.py +7 -4
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aura_api_responses.py +7 -5
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aurads_sessions.py +18 -8
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/dedicated_sessions.py +25 -7
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/session_info.py +2 -1
- graphdatascience-1.11a3/graphdatascience/session/session_sizes.py +70 -0
- graphdatascience-1.11a3/graphdatascience/version.py +1 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3/graphdatascience.egg-info}/PKG-INFO +3 -2
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience.egg-info/SOURCES.txt +0 -1
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience.egg-info/requires.txt +2 -1
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/requirements/base/base.txt +2 -1
- graphdatascience-1.11a2/graphdatascience/session/schema.py +0 -13
- graphdatascience-1.11a2/graphdatascience/session/session_sizes.py +0 -31
- graphdatascience-1.11a2/graphdatascience/version.py +0 -1
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/LICENSE +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/MANIFEST.in +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/README.md +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/algo/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/algo/algo_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/algo/algo_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/call_builder.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/call_parameters.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/caller_base.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/client_only_endpoint.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/cypher_warning_handler.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/endpoint_suggester.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/gds_not_installed.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/illegal_attr_checker.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/unable_to_connect.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/error/uncallable_namespace.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_alpha_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_beta_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_create_result.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_cypher_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_export_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_object.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_project_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_sample_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/graph_type_check.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/nx_loader.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/ogb_loader.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph_data_science.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/ignored_server_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/graphsage_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/link_prediction_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model_alpha_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model_beta_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/model_resolver.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/node_classification_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/node_regression_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/pipeline_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/model/simple_rel_embedding_model.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/nc_training_pipeline.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/nr_training_pipeline.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/pipeline/training_pipeline.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/py.typed +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/arrow_endpoint_version.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/arrow_graph_constructor.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/arrow_query_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/cypher_graph_constructor.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/graph_constructor.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/neo4j_query_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/query_runner/query_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/cora/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/cora/serialize_cora.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/karate/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/server_version/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/server_version/compatible_with.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/server_version/server_version.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/algorithm_category.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aura_graph_data_science.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/dbms_connection_info.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/gds_sessions.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/region_suggester.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/system/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/system/config_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/system/system_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/topological_lp/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/utils/__init__.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/utils/util_endpoints.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/utils/util_proc_runner.py +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience.egg-info/dependency_links.txt +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience.egg-info/not-zip-safe +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience.egg-info/top_level.txt +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/pyproject.toml +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/requirements/base/networkx.txt +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/requirements/base/ogb.txt +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/setup.cfg +0 -0
- {graphdatascience-1.11a2 → graphdatascience-1.11a3}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: graphdatascience
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.11a3
|
|
4
4
|
Summary: A Python client for the Neo4j Graph Data Science (GDS) library
|
|
5
5
|
Home-page: https://neo4j.com/product/graph-data-science/
|
|
6
6
|
Author: Neo4j
|
|
@@ -30,8 +30,9 @@ Description-Content-Type: text/markdown
|
|
|
30
30
|
License-File: LICENSE
|
|
31
31
|
Requires-Dist: multimethod<2.0,>=1.0
|
|
32
32
|
Requires-Dist: neo4j<6.0,>=4.4.2
|
|
33
|
+
Requires-Dist: numpy<2.0
|
|
33
34
|
Requires-Dist: pandas<3.0,>=1.0
|
|
34
|
-
Requires-Dist: pyarrow<
|
|
35
|
+
Requires-Dist: pyarrow<17.0,>=14.0.1
|
|
35
36
|
Requires-Dist: textdistance<5.0,>=4.0
|
|
36
37
|
Requires-Dist: tqdm<5.0,>=4.0
|
|
37
38
|
Requires-Dist: typing-extensions<5.0,>=4.0
|
{graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/graph/base_graph_proc_runner.py
RENAMED
|
@@ -15,12 +15,12 @@ from ..error.uncallable_namespace import UncallableNamespace
|
|
|
15
15
|
from ..server_version.compatible_with import compatible_with
|
|
16
16
|
from ..server_version.server_version import ServerVersion
|
|
17
17
|
from .graph_entity_ops_runner import (
|
|
18
|
-
GraphElementPropertyRunner,
|
|
19
18
|
GraphLabelRunner,
|
|
20
19
|
GraphNodePropertiesRunner,
|
|
21
20
|
GraphNodePropertyRunner,
|
|
22
21
|
GraphPropertyRunner,
|
|
23
22
|
GraphRelationshipPropertiesRunner,
|
|
23
|
+
GraphRelationshipPropertyRunner,
|
|
24
24
|
GraphRelationshipRunner,
|
|
25
25
|
GraphRelationshipsRunner,
|
|
26
26
|
)
|
|
@@ -390,9 +390,9 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
390
390
|
return GraphNodePropertiesRunner(self._query_runner, self._namespace, self._server_version)
|
|
391
391
|
|
|
392
392
|
@property
|
|
393
|
-
def relationshipProperty(self) ->
|
|
393
|
+
def relationshipProperty(self) -> GraphRelationshipPropertyRunner:
|
|
394
394
|
self._namespace += ".relationshipProperty"
|
|
395
|
-
return
|
|
395
|
+
return GraphRelationshipPropertyRunner(self._query_runner, self._namespace, self._server_version)
|
|
396
396
|
|
|
397
397
|
@property
|
|
398
398
|
def relationshipProperties(self) -> GraphRelationshipPropertiesRunner:
|
|
@@ -70,13 +70,6 @@ class GraphEntityOpsBaseRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
70
70
|
)
|
|
71
71
|
|
|
72
72
|
|
|
73
|
-
class GraphElementPropertyRunner(GraphEntityOpsBaseRunner):
|
|
74
|
-
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
75
|
-
def stream(self, G: Graph, node_properties: str, node_labels: Strings = ["*"], **config: Any) -> DataFrame:
|
|
76
|
-
self._namespace += ".stream"
|
|
77
|
-
return self._handle_properties(G, node_properties, node_labels, config)
|
|
78
|
-
|
|
79
|
-
|
|
80
73
|
class GraphNodePropertyRunner(GraphEntityOpsBaseRunner):
|
|
81
74
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
82
75
|
@filter_id_func_deprecation_warning()
|
|
@@ -197,6 +190,16 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
197
190
|
).squeeze()
|
|
198
191
|
|
|
199
192
|
|
|
193
|
+
class GraphRelationshipPropertyRunner(GraphEntityOpsBaseRunner):
|
|
194
|
+
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
195
|
+
def stream(
|
|
196
|
+
self, G: Graph, relationship_property: str, relationship_types: Strings = ["*"], **config: Any
|
|
197
|
+
) -> DataFrame:
|
|
198
|
+
self._namespace += ".stream"
|
|
199
|
+
relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types
|
|
200
|
+
return self._handle_properties(G, relationship_property, relationship_types, config)
|
|
201
|
+
|
|
202
|
+
|
|
200
203
|
class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
201
204
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
202
205
|
def stream(
|
|
@@ -209,6 +212,8 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
209
212
|
) -> DataFrame:
|
|
210
213
|
self._namespace += ".stream"
|
|
211
214
|
|
|
215
|
+
relationship_types = [relationship_types] if isinstance(relationship_types, str) else relationship_types
|
|
216
|
+
|
|
212
217
|
result = self._handle_properties(G, relationship_properties, relationship_types, config)
|
|
213
218
|
|
|
214
219
|
# new format was requested, but the query was run via Cypher
|
|
@@ -20,18 +20,24 @@ class GraphProjectRemoteRunner(IllegalAttrChecker):
|
|
|
20
20
|
concurrency: int = 4,
|
|
21
21
|
undirected_relationship_types: Optional[List[str]] = None,
|
|
22
22
|
inverse_indexed_relationship_types: Optional[List[str]] = None,
|
|
23
|
+
batch_size: Optional[int] = None,
|
|
23
24
|
) -> GraphCreateResult:
|
|
24
25
|
if inverse_indexed_relationship_types is None:
|
|
25
26
|
inverse_indexed_relationship_types = []
|
|
26
27
|
if undirected_relationship_types is None:
|
|
27
28
|
undirected_relationship_types = []
|
|
28
29
|
|
|
30
|
+
arrow_configuration = {}
|
|
31
|
+
if batch_size is not None:
|
|
32
|
+
arrow_configuration["batchSize"] = batch_size
|
|
33
|
+
|
|
29
34
|
params = CallParameters(
|
|
30
35
|
graph_name=graph_name,
|
|
31
36
|
query=query,
|
|
32
37
|
concurrency=concurrency,
|
|
33
38
|
undirected_relationship_types=undirected_relationship_types,
|
|
34
39
|
inverse_indexed_relationship_types=inverse_indexed_relationship_types,
|
|
40
|
+
arrow_configuration=arrow_configuration,
|
|
35
41
|
)
|
|
36
42
|
|
|
37
43
|
result = self._query_runner.call_procedure(
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from typing import Any, Dict, List, Optional
|
|
3
|
+
from uuid import uuid4
|
|
3
4
|
|
|
4
5
|
from pandas import DataFrame
|
|
5
6
|
|
|
@@ -47,7 +48,7 @@ class AuraDbQueryRunner(QueryRunner):
|
|
|
47
48
|
params = CallParameters()
|
|
48
49
|
|
|
49
50
|
if AuraDbQueryRunner.GDS_REMOTE_PROJECTION_PROC_NAME == endpoint:
|
|
50
|
-
return self._remote_projection(endpoint, params, yields, database, logging
|
|
51
|
+
return self._remote_projection(endpoint, params, yields, database, logging)
|
|
51
52
|
|
|
52
53
|
elif ".write" in endpoint and self.is_remote_projected_graph(params["graph_name"]):
|
|
53
54
|
return self._remote_write_back(endpoint, params, yields, database, logging, custom_error)
|
|
@@ -103,9 +104,8 @@ class AuraDbQueryRunner(QueryRunner):
|
|
|
103
104
|
yields: Optional[List[str]] = None,
|
|
104
105
|
database: Optional[str] = None,
|
|
105
106
|
logging: bool = False,
|
|
106
|
-
custom_error: bool = True,
|
|
107
107
|
) -> DataFrame:
|
|
108
|
-
self.
|
|
108
|
+
self._inject_arrow_config(params["arrow_configuration"])
|
|
109
109
|
return self._db_query_runner.call_procedure(endpoint, params, yields, database, logging, False)
|
|
110
110
|
|
|
111
111
|
def _remote_write_back(
|
|
@@ -120,21 +120,29 @@ class AuraDbQueryRunner(QueryRunner):
|
|
|
120
120
|
if params["config"] is None:
|
|
121
121
|
params["config"] = {}
|
|
122
122
|
|
|
123
|
+
# we pop these out so that they are not retained for the GDS proc call
|
|
124
|
+
db_arrow_config = params["config"].pop("arrowConfiguration", {}) # type: ignore
|
|
125
|
+
self._inject_arrow_config(db_arrow_config)
|
|
126
|
+
|
|
127
|
+
job_id = params["config"]["jobId"] if "jobId" in params["config"] else str(uuid4()) # type: ignore
|
|
128
|
+
params["config"]["jobId"] = job_id # type: ignore
|
|
129
|
+
|
|
123
130
|
params["config"]["writeToResultStore"] = True # type: ignore
|
|
131
|
+
|
|
124
132
|
gds_write_result = self._gds_query_runner.call_procedure(
|
|
125
133
|
endpoint, params, yields, database, logging, custom_error
|
|
126
134
|
)
|
|
127
135
|
|
|
128
|
-
|
|
136
|
+
db_write_proc_params = {
|
|
129
137
|
"graphName": params["graph_name"],
|
|
130
138
|
"databaseName": self._gds_query_runner.database(),
|
|
131
|
-
"
|
|
139
|
+
"jobId": job_id,
|
|
140
|
+
"arrowConfiguration": db_arrow_config,
|
|
132
141
|
}
|
|
133
|
-
self._inject_connection_parameters(write_params)
|
|
134
142
|
|
|
135
143
|
write_back_start = time.time()
|
|
136
144
|
database_write_result = self._db_query_runner.call_procedure(
|
|
137
|
-
"gds.arrow.write", CallParameters(
|
|
145
|
+
"gds.arrow.write", CallParameters(db_write_proc_params), yields, None, False, False
|
|
138
146
|
)
|
|
139
147
|
write_millis = (time.time() - write_back_start) * 1000
|
|
140
148
|
gds_write_result["writeMillis"] = write_millis
|
|
@@ -150,75 +158,13 @@ class AuraDbQueryRunner(QueryRunner):
|
|
|
150
158
|
|
|
151
159
|
return gds_write_result
|
|
152
160
|
|
|
153
|
-
def
|
|
161
|
+
def _inject_arrow_config(self, params: Dict[str, Any]) -> None:
|
|
154
162
|
host, port = self._gds_arrow_client.connection_info()
|
|
155
163
|
token = self._gds_arrow_client.request_token()
|
|
156
164
|
if token is None:
|
|
157
165
|
token = "IGNORED"
|
|
158
|
-
params["arrowConfiguration"] = {
|
|
159
|
-
"host": host,
|
|
160
|
-
"port": port,
|
|
161
|
-
"token": token,
|
|
162
|
-
"encrypted": self._encrypted,
|
|
163
|
-
}
|
|
164
166
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
if "writeConcurrency" in config:
|
|
171
|
-
write_config["concurrency"] = config["writeConcurrency"]
|
|
172
|
-
elif "concurrency" in config:
|
|
173
|
-
write_config["concurrency"] = config["concurrency"]
|
|
174
|
-
|
|
175
|
-
if "gds.shortestPath" in proc_name or "gds.allShortestPaths" in proc_name:
|
|
176
|
-
write_config["relationshipType"] = config["writeRelationshipType"]
|
|
177
|
-
|
|
178
|
-
write_node_ids = config.get("writeNodeIds")
|
|
179
|
-
write_costs = config.get("writeCosts")
|
|
180
|
-
|
|
181
|
-
if write_node_ids and write_costs:
|
|
182
|
-
write_config["relationshipProperties"] = ["totalCost", "nodeIds", "costs"]
|
|
183
|
-
elif write_node_ids:
|
|
184
|
-
write_config["relationshipProperties"] = ["totalCost", "nodeIds"]
|
|
185
|
-
elif write_costs:
|
|
186
|
-
write_config["relationshipProperties"] = ["totalCost", "costs"]
|
|
187
|
-
else:
|
|
188
|
-
write_config["relationshipProperties"] = ["totalCost"]
|
|
189
|
-
|
|
190
|
-
elif "gds.graph." in proc_name:
|
|
191
|
-
if "gds.graph.nodeProperties.write" == proc_name:
|
|
192
|
-
properties = params["properties"]
|
|
193
|
-
write_config["nodeProperties"] = properties if isinstance(properties, list) else [properties]
|
|
194
|
-
write_config["nodeLabels"] = params["entities"]
|
|
195
|
-
|
|
196
|
-
elif "gds.graph.nodeLabel.write" == proc_name:
|
|
197
|
-
write_config["nodeLabels"] = [params["node_label"]]
|
|
198
|
-
|
|
199
|
-
elif "gds.graph.relationshipProperties.write" == proc_name:
|
|
200
|
-
write_config["relationshipProperties"] = params["relationship_properties"]
|
|
201
|
-
write_config["relationshipType"] = params["relationship_type"]
|
|
202
|
-
|
|
203
|
-
elif "gds.graph.relationship.write" == proc_name:
|
|
204
|
-
if "relationship_property" in params and params["relationship_property"] != "":
|
|
205
|
-
write_config["relationshipProperties"] = [params["relationship_property"]]
|
|
206
|
-
write_config["relationshipType"] = params["relationship_type"]
|
|
207
|
-
|
|
208
|
-
else:
|
|
209
|
-
raise ValueError(f"Unsupported procedure name: {proc_name}")
|
|
210
|
-
|
|
211
|
-
else:
|
|
212
|
-
if "writeRelationshipType" in config:
|
|
213
|
-
write_config["relationshipType"] = config["writeRelationshipType"]
|
|
214
|
-
if "writeProperty" in config:
|
|
215
|
-
write_config["relationshipProperties"] = [config["writeProperty"]]
|
|
216
|
-
else:
|
|
217
|
-
if "writeProperty" in config:
|
|
218
|
-
write_config["nodeProperties"] = [config["writeProperty"]]
|
|
219
|
-
if "nodeLabels" in params:
|
|
220
|
-
write_config["nodeLabels"] = params["nodeLabels"]
|
|
221
|
-
else:
|
|
222
|
-
write_config["nodeLabels"] = ["*"]
|
|
223
|
-
|
|
224
|
-
return write_config
|
|
167
|
+
params["host"] = host
|
|
168
|
+
params["port"] = port
|
|
169
|
+
params["token"] = token
|
|
170
|
+
params["encrypted"] = self._encrypted
|
|
@@ -18,8 +18,10 @@ from .query_runner import QueryRunner
|
|
|
18
18
|
class GdsArrowClient:
|
|
19
19
|
@staticmethod
|
|
20
20
|
def is_arrow_enabled(query_runner: QueryRunner) -> bool:
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
arrow_server_running = query_runner.call_procedure(
|
|
22
|
+
endpoint="gds.debug.arrow", custom_error=False, yields=["running", "listenAddress"]
|
|
23
|
+
).squeeze()
|
|
24
|
+
return not not arrow_server_running["running"]
|
|
23
25
|
|
|
24
26
|
@staticmethod
|
|
25
27
|
def create(
|
|
@@ -30,14 +32,24 @@ class GdsArrowClient:
|
|
|
30
32
|
tls_root_certs: Optional[bytes] = None,
|
|
31
33
|
connection_string_override: Optional[str] = None,
|
|
32
34
|
) -> "GdsArrowClient":
|
|
33
|
-
|
|
35
|
+
if query_runner.server_version() > ServerVersion(2, 6, 0):
|
|
36
|
+
debugYields = ["listenAddress", "versions"]
|
|
37
|
+
else:
|
|
38
|
+
# return enabled to avoid squeeze returning a single str
|
|
39
|
+
debugYields = ["listenAddress", "enabled"]
|
|
40
|
+
|
|
41
|
+
arrow_info = (
|
|
42
|
+
query_runner.call_procedure(endpoint="gds.debug.arrow", custom_error=False, yields=debugYields)
|
|
43
|
+
.squeeze()
|
|
44
|
+
.to_dict()
|
|
45
|
+
)
|
|
34
46
|
|
|
35
47
|
server_version = query_runner.server_version()
|
|
36
48
|
connection_string: str
|
|
37
49
|
if connection_string_override is not None:
|
|
38
50
|
connection_string = connection_string_override
|
|
39
51
|
else:
|
|
40
|
-
connection_string = arrow_info.get("
|
|
52
|
+
connection_string = arrow_info.get("listenAddress")
|
|
41
53
|
|
|
42
54
|
host, port = connection_string.split(":")
|
|
43
55
|
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
from .algorithm_category import AlgorithmCategory
|
|
2
2
|
from .dbms_connection_info import DbmsConnectionInfo
|
|
3
3
|
from .gds_sessions import AuraAPICredentials, GdsSessions
|
|
4
|
-
from .schema import GdsPropertyTypes
|
|
5
4
|
from .session_info import SessionInfo
|
|
6
|
-
from .session_sizes import SessionMemory
|
|
5
|
+
from .session_sizes import SessionMemory, SessionMemoryValue
|
|
7
6
|
|
|
8
7
|
__all__ = [
|
|
9
8
|
"GdsSessions",
|
|
@@ -11,6 +10,6 @@ __all__ = [
|
|
|
11
10
|
"DbmsConnectionInfo",
|
|
12
11
|
"AuraAPICredentials",
|
|
13
12
|
"SessionMemory",
|
|
14
|
-
"
|
|
13
|
+
"SessionMemoryValue",
|
|
15
14
|
"AlgorithmCategory",
|
|
16
15
|
]
|
|
@@ -19,6 +19,7 @@ from graphdatascience.session.aura_api_responses import (
|
|
|
19
19
|
TenantDetails,
|
|
20
20
|
WaitResult,
|
|
21
21
|
)
|
|
22
|
+
from graphdatascience.session.session_sizes import SessionMemoryValue
|
|
22
23
|
from graphdatascience.version import __version__
|
|
23
24
|
|
|
24
25
|
|
|
@@ -62,11 +63,11 @@ class AuraApi:
|
|
|
62
63
|
|
|
63
64
|
return host.split(".")[0].split("-")[0]
|
|
64
65
|
|
|
65
|
-
def create_session(self, name: str, dbid: str, pwd: str, memory:
|
|
66
|
+
def create_session(self, name: str, dbid: str, pwd: str, memory: SessionMemoryValue) -> SessionDetails:
|
|
66
67
|
response = req.post(
|
|
67
68
|
f"{self._base_uri}/v1beta5/data-science/sessions",
|
|
68
69
|
headers=self._build_header(),
|
|
69
|
-
json={"name": name, "instance_id": dbid, "password": pwd, "memory": memory},
|
|
70
|
+
json={"name": name, "instance_id": dbid, "password": pwd, "memory": memory.value},
|
|
70
71
|
)
|
|
71
72
|
|
|
72
73
|
response.raise_for_status()
|
|
@@ -141,12 +142,14 @@ class AuraApi:
|
|
|
141
142
|
|
|
142
143
|
return False
|
|
143
144
|
|
|
144
|
-
def create_instance(
|
|
145
|
+
def create_instance(
|
|
146
|
+
self, name: str, memory: SessionMemoryValue, cloud_provider: str, region: str
|
|
147
|
+
) -> InstanceCreateDetails:
|
|
145
148
|
tenant_details = self.tenant_details()
|
|
146
149
|
|
|
147
150
|
data = {
|
|
148
151
|
"name": name,
|
|
149
|
-
"memory": memory,
|
|
152
|
+
"memory": memory.value,
|
|
150
153
|
"version": "5",
|
|
151
154
|
"region": region,
|
|
152
155
|
"type": tenant_details.ds_type,
|
{graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aura_api_responses.py
RENAMED
|
@@ -9,13 +9,15 @@ from typing import Any, Dict, NamedTuple, Optional, Set
|
|
|
9
9
|
|
|
10
10
|
from pandas import Timedelta
|
|
11
11
|
|
|
12
|
+
from .session_sizes import SessionMemoryValue
|
|
13
|
+
|
|
12
14
|
|
|
13
15
|
@dataclass(repr=True, frozen=True)
|
|
14
16
|
class SessionDetails:
|
|
15
17
|
id: str
|
|
16
18
|
name: str
|
|
17
19
|
instance_id: str
|
|
18
|
-
memory:
|
|
20
|
+
memory: SessionMemoryValue
|
|
19
21
|
status: str
|
|
20
22
|
host: str
|
|
21
23
|
created_at: datetime
|
|
@@ -31,7 +33,7 @@ class SessionDetails:
|
|
|
31
33
|
id=json["id"],
|
|
32
34
|
name=json["name"],
|
|
33
35
|
instance_id=json["instance_id"],
|
|
34
|
-
memory=json["memory"],
|
|
36
|
+
memory=SessionMemoryValue.fromApiResponse(json["memory"]),
|
|
35
37
|
status=json["status"],
|
|
36
38
|
host=json["host"],
|
|
37
39
|
expiry_date=TimeParser.fromisoformat(expiry_date) if expiry_date else None,
|
|
@@ -40,7 +42,7 @@ class SessionDetails:
|
|
|
40
42
|
)
|
|
41
43
|
|
|
42
44
|
def bolt_connection_url(self) -> str:
|
|
43
|
-
return f"neo4j+
|
|
45
|
+
return f"neo4j+s://{self.host}"
|
|
44
46
|
|
|
45
47
|
def is_expired(self) -> bool:
|
|
46
48
|
return self.status == "Expired"
|
|
@@ -67,7 +69,7 @@ class InstanceDetails:
|
|
|
67
69
|
class InstanceSpecificDetails(InstanceDetails):
|
|
68
70
|
status: str
|
|
69
71
|
connection_url: str
|
|
70
|
-
memory:
|
|
72
|
+
memory: SessionMemoryValue
|
|
71
73
|
type: str
|
|
72
74
|
region: str
|
|
73
75
|
|
|
@@ -80,7 +82,7 @@ class InstanceSpecificDetails(InstanceDetails):
|
|
|
80
82
|
cloud_provider=json["cloud_provider"],
|
|
81
83
|
status=json["status"],
|
|
82
84
|
connection_url=json.get("connection_url", ""),
|
|
83
|
-
memory=json.get("memory"
|
|
85
|
+
memory=SessionMemoryValue.fromInstanceSize(json.get("memory")),
|
|
84
86
|
type=json["type"],
|
|
85
87
|
region=json["region"],
|
|
86
88
|
)
|
{graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/aurads_sessions.py
RENAMED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
+
import logging
|
|
3
4
|
import warnings
|
|
4
5
|
from typing import List, Optional
|
|
5
6
|
|
|
@@ -16,7 +17,11 @@ from graphdatascience.session.aura_graph_data_science import AuraGraphDataScienc
|
|
|
16
17
|
from graphdatascience.session.dbms_connection_info import DbmsConnectionInfo
|
|
17
18
|
from graphdatascience.session.region_suggester import closest_match
|
|
18
19
|
from graphdatascience.session.session_info import SessionInfo
|
|
19
|
-
from graphdatascience.session.session_sizes import
|
|
20
|
+
from graphdatascience.session.session_sizes import (
|
|
21
|
+
SESSION_MEMORY_VALUE_UNKNOWN,
|
|
22
|
+
SessionMemory,
|
|
23
|
+
SessionMemoryValue,
|
|
24
|
+
)
|
|
20
25
|
|
|
21
26
|
|
|
22
27
|
class AuraDsSessions:
|
|
@@ -25,6 +30,7 @@ class AuraDsSessions:
|
|
|
25
30
|
|
|
26
31
|
def __init__(self, aura_api: AuraApi) -> None:
|
|
27
32
|
self._aura_api = aura_api
|
|
33
|
+
self._logger = logging.getLogger()
|
|
28
34
|
|
|
29
35
|
def estimate(
|
|
30
36
|
self, node_count: int, relationship_count: int, algorithm_categories: Optional[List[AlgorithmCategory]] = None
|
|
@@ -41,7 +47,7 @@ class AuraDsSessions:
|
|
|
41
47
|
ResourceWarning,
|
|
42
48
|
)
|
|
43
49
|
|
|
44
|
-
return SessionMemory(estimation.recommended_size)
|
|
50
|
+
return SessionMemory(SessionMemoryValue(estimation.recommended_size))
|
|
45
51
|
|
|
46
52
|
def get_or_create(
|
|
47
53
|
self,
|
|
@@ -53,14 +59,18 @@ class AuraDsSessions:
|
|
|
53
59
|
|
|
54
60
|
if existing_session:
|
|
55
61
|
session_id = existing_session.id
|
|
56
|
-
#
|
|
57
|
-
if existing_session.memory
|
|
62
|
+
# AuraAPI default value for memory if none can be retrieved
|
|
63
|
+
if existing_session.memory == SESSION_MEMORY_VALUE_UNKNOWN:
|
|
64
|
+
self._logger.debug(
|
|
65
|
+
f"Reusing existing session with id `{session_id}` as size for session is unknown during creation."
|
|
66
|
+
)
|
|
67
|
+
elif existing_session.memory != memory.value:
|
|
58
68
|
raise ValueError(
|
|
59
|
-
f"Session `{session_name}` already exists with memory `{existing_session.memory}`. "
|
|
69
|
+
f"Session `{session_name}` already exists with memory `{existing_session.memory.value}`. "
|
|
60
70
|
f"Requested memory `{memory.value}` does not match."
|
|
61
71
|
)
|
|
62
72
|
else:
|
|
63
|
-
create_details = self._create_session(session_name, memory, db_connection)
|
|
73
|
+
create_details = self._create_session(session_name, memory.value, db_connection)
|
|
64
74
|
session_id = create_details.id
|
|
65
75
|
|
|
66
76
|
wait_result = self._aura_api.wait_for_instance_running(session_id)
|
|
@@ -118,7 +128,7 @@ class AuraDsSessions:
|
|
|
118
128
|
return self._aura_api.list_instance(matched_instances[0].id)
|
|
119
129
|
|
|
120
130
|
def _create_session(
|
|
121
|
-
self, session_name: str, memory:
|
|
131
|
+
self, session_name: str, memory: SessionMemoryValue, db_connection: DbmsConnectionInfo
|
|
122
132
|
) -> InstanceCreateDetails:
|
|
123
133
|
db_instance_id = AuraApi.extract_id(db_connection.uri)
|
|
124
134
|
db_instance = self._aura_api.list_instance(db_instance_id)
|
|
@@ -128,7 +138,7 @@ class AuraDsSessions:
|
|
|
128
138
|
region = self._ds_region(db_instance.region, db_instance.cloud_provider)
|
|
129
139
|
|
|
130
140
|
create_details = self._aura_api.create_instance(
|
|
131
|
-
SessionNameHelper.instance_name(session_name), memory
|
|
141
|
+
SessionNameHelper.instance_name(session_name), memory, db_instance.cloud_provider, region
|
|
132
142
|
)
|
|
133
143
|
return create_details
|
|
134
144
|
|
{graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/dedicated_sessions.py
RENAMED
|
@@ -5,13 +5,15 @@ import warnings
|
|
|
5
5
|
from datetime import datetime, timedelta, timezone
|
|
6
6
|
from typing import List, Optional
|
|
7
7
|
|
|
8
|
+
from requests.exceptions import HTTPError
|
|
9
|
+
|
|
8
10
|
from graphdatascience.session.algorithm_category import AlgorithmCategory
|
|
9
11
|
from graphdatascience.session.aura_api import AuraApi
|
|
10
12
|
from graphdatascience.session.aura_api_responses import SessionDetails
|
|
11
13
|
from graphdatascience.session.aura_graph_data_science import AuraGraphDataScience
|
|
12
14
|
from graphdatascience.session.dbms_connection_info import DbmsConnectionInfo
|
|
13
15
|
from graphdatascience.session.session_info import SessionInfo
|
|
14
|
-
from graphdatascience.session.session_sizes import SessionMemory
|
|
16
|
+
from graphdatascience.session.session_sizes import SessionMemory, SessionMemoryValue
|
|
15
17
|
|
|
16
18
|
|
|
17
19
|
class DedicatedSessions:
|
|
@@ -35,7 +37,7 @@ class DedicatedSessions:
|
|
|
35
37
|
ResourceWarning,
|
|
36
38
|
)
|
|
37
39
|
|
|
38
|
-
return SessionMemory(estimation.recommended_size)
|
|
40
|
+
return SessionMemory(SessionMemoryValue(estimation.recommended_size))
|
|
39
41
|
|
|
40
42
|
def get_or_create(
|
|
41
43
|
self,
|
|
@@ -52,9 +54,10 @@ class DedicatedSessions:
|
|
|
52
54
|
# TODO configure session size (and check existing_session has same size)
|
|
53
55
|
if existing_session:
|
|
54
56
|
self._check_expiry_date(existing_session)
|
|
57
|
+
self._check_memory_configuration(existing_session, memory.value)
|
|
55
58
|
session_id = existing_session.id
|
|
56
59
|
else:
|
|
57
|
-
create_details = self._create_session(session_name, dbid, db_connection.uri, password, memory)
|
|
60
|
+
create_details = self._create_session(session_name, dbid, db_connection.uri, password, memory.value)
|
|
58
61
|
session_id = create_details.id
|
|
59
62
|
|
|
60
63
|
wait_result = self._aura_api.wait_for_session_running(session_id, dbid)
|
|
@@ -78,12 +81,13 @@ class DedicatedSessions:
|
|
|
78
81
|
for db in dbs:
|
|
79
82
|
candidate = self._find_existing_session(session_name, db.id)
|
|
80
83
|
if candidate:
|
|
84
|
+
dbid = db.id
|
|
81
85
|
break
|
|
82
86
|
else:
|
|
83
87
|
candidate = self._find_existing_session(session_name, dbid)
|
|
84
88
|
|
|
85
89
|
if candidate:
|
|
86
|
-
return self._aura_api.delete_session(candidate.id,
|
|
90
|
+
return self._aura_api.delete_session(candidate.id, str(dbid)) is not None
|
|
87
91
|
|
|
88
92
|
return False
|
|
89
93
|
|
|
@@ -92,7 +96,12 @@ class DedicatedSessions:
|
|
|
92
96
|
|
|
93
97
|
sessions: List[SessionDetails] = []
|
|
94
98
|
for db in dbs:
|
|
95
|
-
|
|
99
|
+
try:
|
|
100
|
+
sessions.extend(self._aura_api.list_sessions(db.id))
|
|
101
|
+
except HTTPError as e:
|
|
102
|
+
# ignore 404 errors when listing sessions as it could mean paused sessions or deleted sessions
|
|
103
|
+
if e.response.status_code != 404:
|
|
104
|
+
raise e
|
|
96
105
|
|
|
97
106
|
return [SessionInfo.from_session_details(i) for i in sessions]
|
|
98
107
|
|
|
@@ -108,7 +117,7 @@ class DedicatedSessions:
|
|
|
108
117
|
return matched_sessions[0]
|
|
109
118
|
|
|
110
119
|
def _create_session(
|
|
111
|
-
self, session_name: str, dbid: str, dburi: str, pwd: str, memory:
|
|
120
|
+
self, session_name: str, dbid: str, dburi: str, pwd: str, memory: SessionMemoryValue
|
|
112
121
|
) -> SessionDetails:
|
|
113
122
|
db_instance = self._aura_api.list_instance(dbid)
|
|
114
123
|
if not db_instance:
|
|
@@ -118,7 +127,7 @@ class DedicatedSessions:
|
|
|
118
127
|
name=session_name,
|
|
119
128
|
dbid=dbid,
|
|
120
129
|
pwd=pwd,
|
|
121
|
-
memory=memory
|
|
130
|
+
memory=memory,
|
|
122
131
|
)
|
|
123
132
|
return create_details
|
|
124
133
|
|
|
@@ -139,6 +148,15 @@ class DedicatedSessions:
|
|
|
139
148
|
if until_expiry < timedelta(days=1):
|
|
140
149
|
raise Warning(f"Session `{session.name}` is expiring in less than a day.")
|
|
141
150
|
|
|
151
|
+
def _check_memory_configuration(
|
|
152
|
+
self, existing_session: SessionDetails, requested_memory: SessionMemoryValue
|
|
153
|
+
) -> None:
|
|
154
|
+
if existing_session.memory != requested_memory:
|
|
155
|
+
raise RuntimeError(
|
|
156
|
+
f"Session `{existing_session.name}` exists with a different memory configuration. "
|
|
157
|
+
f"Current: {existing_session.memory}, Requested: {requested_memory}."
|
|
158
|
+
)
|
|
159
|
+
|
|
142
160
|
@classmethod
|
|
143
161
|
def _fail_ambiguous_session(cls, session_name: str, sessions: List[SessionDetails]) -> None:
|
|
144
162
|
candidates = [i.id for i in sessions]
|
{graphdatascience-1.11a2 → graphdatascience-1.11a3}/graphdatascience/session/session_info.py
RENAMED
|
@@ -5,6 +5,7 @@ from datetime import datetime
|
|
|
5
5
|
from typing import Optional
|
|
6
6
|
|
|
7
7
|
from graphdatascience.session.aura_api_responses import SessionDetails
|
|
8
|
+
from graphdatascience.session.session_sizes import SessionMemoryValue
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
@dataclass(frozen=True)
|
|
@@ -18,7 +19,7 @@ class SessionInfo:
|
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
21
|
name: str
|
|
21
|
-
memory:
|
|
22
|
+
memory: SessionMemoryValue
|
|
22
23
|
|
|
23
24
|
@classmethod
|
|
24
25
|
def from_session_details(cls, details: SessionDetails) -> ExtendedSessionInfo:
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from dataclasses import dataclass
|
|
4
|
+
from enum import Enum
|
|
5
|
+
from typing import List, Optional
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
@dataclass(frozen=True)
|
|
9
|
+
class SessionMemoryValue:
|
|
10
|
+
value: str
|
|
11
|
+
|
|
12
|
+
def __str__(self) -> str:
|
|
13
|
+
return self.value
|
|
14
|
+
|
|
15
|
+
@staticmethod
|
|
16
|
+
def fromApiResponse(value: str) -> SessionMemoryValue:
|
|
17
|
+
"""
|
|
18
|
+
Converts the string value from an API response to a SessionMemory enumeration value.
|
|
19
|
+
|
|
20
|
+
Args:
|
|
21
|
+
value: The string value from the API response.
|
|
22
|
+
|
|
23
|
+
Returns:
|
|
24
|
+
The SessionMemory enumeration value.
|
|
25
|
+
|
|
26
|
+
"""
|
|
27
|
+
if value == "":
|
|
28
|
+
raise ValueError("memory configuration cannot be empty")
|
|
29
|
+
|
|
30
|
+
return SessionMemoryValue(value.replace("Gi", "GB"))
|
|
31
|
+
|
|
32
|
+
@staticmethod
|
|
33
|
+
def fromInstanceSize(value: Optional[str]) -> SessionMemoryValue:
|
|
34
|
+
if not value:
|
|
35
|
+
return SESSION_MEMORY_VALUE_UNKNOWN
|
|
36
|
+
|
|
37
|
+
return SessionMemoryValue(value.replace("Gi", "GB"))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
SESSION_MEMORY_VALUE_UNKNOWN = SessionMemoryValue("")
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
class SessionMemory(Enum):
|
|
44
|
+
"""
|
|
45
|
+
Enumeration representing session main memory configurations.
|
|
46
|
+
"""
|
|
47
|
+
|
|
48
|
+
m_4GB = SessionMemoryValue("4GB")
|
|
49
|
+
m_8GB = SessionMemoryValue("8GB")
|
|
50
|
+
m_16GB = SessionMemoryValue("16GB")
|
|
51
|
+
m_24GB = SessionMemoryValue("24GB")
|
|
52
|
+
m_32GB = SessionMemoryValue("32GB")
|
|
53
|
+
m_48GB = SessionMemoryValue("48GB")
|
|
54
|
+
m_64GB = SessionMemoryValue("64GB")
|
|
55
|
+
m_96GB = SessionMemoryValue("96GB")
|
|
56
|
+
m_128GB = SessionMemoryValue("128GB")
|
|
57
|
+
m_192GB = SessionMemoryValue("192GB")
|
|
58
|
+
m_256GB = SessionMemoryValue("256GB")
|
|
59
|
+
m_384GB = SessionMemoryValue("384GB")
|
|
60
|
+
|
|
61
|
+
@classmethod
|
|
62
|
+
def all_values(cls) -> List[SessionMemoryValue]:
|
|
63
|
+
"""
|
|
64
|
+
All supported memory configurations.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
A list of strings representing all supported memory configurations for sessions.
|
|
68
|
+
|
|
69
|
+
"""
|
|
70
|
+
return [e.value for e in cls]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "1.11a3"
|