graphdatascience 1.12a1__tar.gz → 1.14__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.12a1/graphdatascience.egg-info → graphdatascience-1.14}/PKG-INFO +21 -8
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/algo/algo_proc_runner.py +4 -3
- graphdatascience-1.14/graphdatascience/call_parameters.py +40 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/endpoint_suggester.py +1 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/base_graph_proc_runner.py +23 -22
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_alpha_proc_runner.py +6 -6
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_beta_proc_runner.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_cypher_runner.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_entity_ops_runner.py +38 -18
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_export_runner.py +3 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_object.py +6 -6
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_remote_project_runner.py +7 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_type_check.py +1 -15
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/nx_loader.py +10 -10
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/ogb_loader.py +30 -36
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph_data_science.py +50 -7
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/link_prediction_model.py +4 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model.py +3 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model_alpha_proc_runner.py +6 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model_proc_runner.py +4 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/node_classification_model.py +4 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/node_regression_model.py +3 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/pipeline_model.py +16 -14
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/simple_rel_embedding_model.py +4 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/lp_pipeline_create_runner.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/nc_pipeline_create_runner.py +4 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/nc_training_pipeline.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/nr_training_pipeline.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/training_pipeline.py +3 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/arrow_endpoint_version.py +3 -11
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/arrow_graph_constructor.py +37 -30
- graphdatascience-1.14/graphdatascience/query_runner/arrow_info.py +31 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/arrow_query_runner.py +78 -104
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/cypher_graph_constructor.py +35 -35
- graphdatascience-1.14/graphdatascience/query_runner/gds_arrow_client.py +876 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/graph_constructor.py +1 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/neo4j_query_runner.py +100 -36
- graphdatascience-1.14/graphdatascience/query_runner/progress/progress_provider.py +18 -0
- graphdatascience-1.14/graphdatascience/query_runner/progress/query_progress_logger.py +135 -0
- graphdatascience-1.14/graphdatascience/query_runner/progress/query_progress_provider.py +53 -0
- graphdatascience-1.14/graphdatascience/query_runner/progress/static_progress_provider.py +27 -0
- graphdatascience-1.14/graphdatascience/query_runner/protocol/project_protocols.py +146 -0
- graphdatascience-1.14/graphdatascience/query_runner/protocol/retry_utils.py +19 -0
- graphdatascience-1.14/graphdatascience/query_runner/protocol/status.py +7 -0
- graphdatascience-1.14/graphdatascience/query_runner/protocol/write_protocols.py +164 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/query_runner.py +9 -5
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/session_query_runner.py +67 -119
- graphdatascience-1.14/graphdatascience/query_runner/termination_flag.py +69 -0
- graphdatascience-1.14/graphdatascience/semantic_version/semantic_version.py +44 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/aura_api.py +76 -27
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/aura_api_responses.py +53 -38
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/aura_graph_data_science.py +38 -16
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/cloud_location.py +1 -1
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/dbms/protocol_resolver.py +5 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/dbms/protocol_version.py +1 -6
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/dbms_connection_info.py +3 -2
- graphdatascience-1.14/graphdatascience/session/dedicated_sessions.py +192 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/gds_sessions.py +25 -6
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/session_info.py +5 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/session_sizes.py +2 -2
- graphdatascience-1.14/graphdatascience/system/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/system/config_endpoints.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/system/system_endpoints.py +15 -0
- graphdatascience-1.14/graphdatascience/topological_lp/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +2 -2
- graphdatascience-1.14/graphdatascience/utils/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/utils/direct_util_endpoints.py +3 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/utils/util_proc_runner.py +2 -2
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/utils/util_remote_proc_runner.py +2 -2
- graphdatascience-1.14/graphdatascience/version.py +2 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14/graphdatascience.egg-info}/PKG-INFO +21 -8
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience.egg-info/SOURCES.txt +14 -1
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience.egg-info/requires.txt +5 -4
- {graphdatascience-1.12a1 → graphdatascience-1.14}/pyproject.toml +1 -1
- {graphdatascience-1.12a1 → graphdatascience-1.14}/requirements/base/base.txt +4 -3
- {graphdatascience-1.12a1 → graphdatascience-1.14}/requirements/base/rust-ext.txt +1 -1
- {graphdatascience-1.12a1 → graphdatascience-1.14}/setup.py +2 -2
- graphdatascience-1.12a1/graphdatascience/call_parameters.py +0 -8
- graphdatascience-1.12a1/graphdatascience/query_runner/gds_arrow_client.py +0 -254
- graphdatascience-1.12a1/graphdatascience/query_runner/query_progress_logger.py +0 -98
- graphdatascience-1.12a1/graphdatascience/session/dedicated_sessions.py +0 -201
- graphdatascience-1.12a1/graphdatascience/version.py +0 -1
- {graphdatascience-1.12a1 → graphdatascience-1.14}/LICENSE +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/MANIFEST.in +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/README.md +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/algo/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/algo/algo_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/call_builder.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/caller_base.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/client_only_endpoint.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/cypher_warning_handler.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/gds_not_installed.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/illegal_attr_checker.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/unable_to_connect.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/uncallable_namespace.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_create_result.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_project_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_sample_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/ignored_server_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/graphsage_model.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model_beta_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/model/model_resolver.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/py.typed +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/query_runner/__init__.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/resources → graphdatascience-1.14/graphdatascience/query_runner/progress}/__init__.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/resources/cora → graphdatascience-1.14/graphdatascience/query_runner/protocol}/__init__.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/resources/imdb → graphdatascience-1.14/graphdatascience/resources}/__init__.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/resources/karate → graphdatascience-1.14/graphdatascience/resources/cora}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/cora/serialize_cora.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/resources/lastfm → graphdatascience-1.14/graphdatascience/resources/imdb}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/server_version → graphdatascience-1.14/graphdatascience/resources/karate}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
- {graphdatascience-1.12a1/graphdatascience/session/dbms → graphdatascience-1.14/graphdatascience/resources/lastfm}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.12a1/graphdatascience/system → graphdatascience-1.14/graphdatascience/semantic_version}/__init__.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/topological_lp → graphdatascience-1.14/graphdatascience/server_version}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/server_version/compatible_with.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/server_version/server_version.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/algorithm_category.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/aurads_sessions.py +0 -0
- {graphdatascience-1.12a1/graphdatascience/utils → graphdatascience-1.14/graphdatascience/session/dbms}/__init__.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/session/region_suggester.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/utils/util_node_property_func_runner.py +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience.egg-info/dependency_links.txt +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience.egg-info/not-zip-safe +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience.egg-info/top_level.txt +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/requirements/base/networkx.txt +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/requirements/base/ogb.txt +0 -0
- {graphdatascience-1.12a1 → graphdatascience-1.14}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
2
|
Name: graphdatascience
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14
|
|
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
|
|
@@ -16,33 +16,46 @@ Classifier: License :: OSI Approved :: Apache Software License
|
|
|
16
16
|
Classifier: Operating System :: OS Independent
|
|
17
17
|
Classifier: Programming Language :: Python :: 3
|
|
18
18
|
Classifier: Programming Language :: Python :: 3 :: Only
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
20
19
|
Classifier: Programming Language :: Python :: 3.9
|
|
21
20
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
24
|
Classifier: Topic :: Database
|
|
25
25
|
Classifier: Topic :: Scientific/Engineering
|
|
26
26
|
Classifier: Topic :: Software Development
|
|
27
27
|
Classifier: Typing :: Typed
|
|
28
|
-
Requires-Python: >=3.
|
|
28
|
+
Requires-Python: >=3.9
|
|
29
29
|
Description-Content-Type: text/markdown
|
|
30
30
|
License-File: LICENSE
|
|
31
|
-
Requires-Dist: multimethod<
|
|
31
|
+
Requires-Dist: multimethod<3.0,>=1.0
|
|
32
32
|
Requires-Dist: neo4j<6.0,>=4.4.12
|
|
33
|
-
Requires-Dist: numpy<2.
|
|
33
|
+
Requires-Dist: numpy<2.3
|
|
34
34
|
Requires-Dist: pandas<3.0,>=1.0
|
|
35
|
-
Requires-Dist: pyarrow<
|
|
35
|
+
Requires-Dist: pyarrow<20.0,>=16.0
|
|
36
36
|
Requires-Dist: textdistance<5.0,>=4.0
|
|
37
37
|
Requires-Dist: tqdm<5.0,>=4.0
|
|
38
38
|
Requires-Dist: typing-extensions<5.0,>=4.0
|
|
39
39
|
Requires-Dist: requests
|
|
40
|
+
Requires-Dist: tenacity>=9.0
|
|
40
41
|
Provides-Extra: ogb
|
|
41
42
|
Requires-Dist: ogb<2.0,>=1.0; extra == "ogb"
|
|
42
43
|
Provides-Extra: networkx
|
|
43
44
|
Requires-Dist: networkx<4.0,>=2.0; extra == "networkx"
|
|
44
45
|
Provides-Extra: rust-ext
|
|
45
|
-
Requires-Dist: neo4j-rust-ext<6.0,>=4.4.
|
|
46
|
+
Requires-Dist: neo4j-rust-ext<6.0,>=4.4.12; extra == "rust-ext"
|
|
47
|
+
Dynamic: author
|
|
48
|
+
Dynamic: author-email
|
|
49
|
+
Dynamic: classifier
|
|
50
|
+
Dynamic: description
|
|
51
|
+
Dynamic: description-content-type
|
|
52
|
+
Dynamic: home-page
|
|
53
|
+
Dynamic: license
|
|
54
|
+
Dynamic: project-url
|
|
55
|
+
Dynamic: provides-extra
|
|
56
|
+
Dynamic: requires-dist
|
|
57
|
+
Dynamic: requires-python
|
|
58
|
+
Dynamic: summary
|
|
46
59
|
|
|
47
60
|
# Neo4j Graph Data Science Client
|
|
48
61
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from abc import ABC
|
|
2
|
-
from typing import Any
|
|
2
|
+
from typing import Any
|
|
3
3
|
|
|
4
4
|
from pandas import DataFrame, Series
|
|
5
5
|
|
|
@@ -12,8 +12,9 @@ from ..model.graphsage_model import GraphSageModel
|
|
|
12
12
|
|
|
13
13
|
class AlgoProcRunner(IllegalAttrChecker, ABC):
|
|
14
14
|
@graph_type_check
|
|
15
|
-
def _run_procedure(self, G: Graph, config:
|
|
15
|
+
def _run_procedure(self, G: Graph, config: dict[str, Any], with_logging: bool = True) -> DataFrame:
|
|
16
16
|
params = CallParameters(graph_name=G.name(), config=config)
|
|
17
|
+
params.ensure_job_id_in_config()
|
|
17
18
|
|
|
18
19
|
return self._query_runner.call_procedure(endpoint=self._namespace, params=params, logging=with_logging)
|
|
19
20
|
|
|
@@ -35,7 +36,7 @@ class StandardModeRunner(AlgoProcRunner):
|
|
|
35
36
|
|
|
36
37
|
class GraphSageRunner(AlgoProcRunner):
|
|
37
38
|
@graph_type_check
|
|
38
|
-
def __call__(self, G: Graph, **config: Any) ->
|
|
39
|
+
def __call__(self, G: Graph, **config: Any) -> tuple[GraphSageModel, "Series[Any]"]:
|
|
39
40
|
result = self._run_procedure(G, config).squeeze()
|
|
40
41
|
model_name = result["modelInfo"]["modelName"]
|
|
41
42
|
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
from collections import OrderedDict
|
|
2
|
+
from typing import Any, Optional
|
|
3
|
+
from uuid import uuid4
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
class CallParameters(OrderedDict[str, Any]):
|
|
7
|
+
# since Python 3.6 also initializing through CallParameters(**kwargs) is order preserving
|
|
8
|
+
|
|
9
|
+
def placeholder_str(self) -> str:
|
|
10
|
+
return ", ".join([f"${k}" for k in self.keys()])
|
|
11
|
+
|
|
12
|
+
def get_job_id(self) -> Optional[str]:
|
|
13
|
+
config = self["config"] if "config" in self else {}
|
|
14
|
+
|
|
15
|
+
job_id = None
|
|
16
|
+
if "jobId" in config:
|
|
17
|
+
job_id = config["jobId"]
|
|
18
|
+
|
|
19
|
+
if "job_id" in config:
|
|
20
|
+
job_id = config["job_id"]
|
|
21
|
+
|
|
22
|
+
if job_id is None:
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
return str(job_id)
|
|
26
|
+
|
|
27
|
+
def ensure_job_id_in_config(self) -> str:
|
|
28
|
+
"""
|
|
29
|
+
Ensure that a job id is present in the `config` parameter. If not, generate a new one.
|
|
30
|
+
This enables the client to check on the progress later on.
|
|
31
|
+
"""
|
|
32
|
+
config = self.get("config")
|
|
33
|
+
|
|
34
|
+
assert config is not None, "config is not set in the parameters. This method should not be called."
|
|
35
|
+
|
|
36
|
+
job_id = self.get_job_id()
|
|
37
|
+
if job_id is None:
|
|
38
|
+
job_id = str(uuid4())
|
|
39
|
+
config["jobId"] = job_id
|
|
40
|
+
return job_id
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/error/endpoint_suggester.py
RENAMED
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
from typing import List
|
|
2
|
-
|
|
3
1
|
import textdistance
|
|
4
2
|
|
|
5
3
|
from ..ignored_server_endpoints import IGNORED_SERVER_ENDPOINTS
|
|
6
4
|
|
|
7
5
|
|
|
8
|
-
def generate_suggestive_error_message(requested_endpoint: str, all_endpoints:
|
|
6
|
+
def generate_suggestive_error_message(requested_endpoint: str, all_endpoints: list[str]) -> str:
|
|
9
7
|
MIN_SIMILARITY_FOR_SUGGESTION = 0.9
|
|
10
8
|
|
|
11
9
|
closest_endpoint = None
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/base_graph_proc_runner.py
RENAMED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
1
3
|
import os
|
|
2
4
|
import pathlib
|
|
3
|
-
import sys
|
|
4
5
|
import warnings
|
|
5
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, List, Optional, Union
|
|
6
7
|
|
|
7
8
|
import pandas as pd
|
|
8
9
|
from multimethod import multimethod
|
|
@@ -32,7 +33,6 @@ from .graph_sample_runner import GraphSampleRunner
|
|
|
32
33
|
from .graph_type_check import (
|
|
33
34
|
from_graph_type_check,
|
|
34
35
|
graph_type_check,
|
|
35
|
-
graph_type_check_optional,
|
|
36
36
|
)
|
|
37
37
|
from .ogb_loader import OGBLLoader, OGBNLoader
|
|
38
38
|
|
|
@@ -53,28 +53,22 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
53
53
|
|
|
54
54
|
@staticmethod
|
|
55
55
|
def _path(package: str, resource: str) -> pathlib.Path:
|
|
56
|
-
|
|
57
|
-
from importlib.resources import files
|
|
58
|
-
|
|
59
|
-
# files() returns a Traversable, but usages require a Path object
|
|
60
|
-
return pathlib.Path(str(files(package) / resource))
|
|
61
|
-
else:
|
|
62
|
-
from importlib.resources import path
|
|
56
|
+
from importlib.resources import files
|
|
63
57
|
|
|
64
|
-
|
|
65
|
-
|
|
58
|
+
# files() returns a Traversable, but usages require a Path object
|
|
59
|
+
return pathlib.Path(str(files(package) / resource))
|
|
66
60
|
|
|
67
61
|
@client_only_endpoint("gds.graph")
|
|
68
62
|
@compatible_with("construct", min_inclusive=ServerVersion(2, 1, 0))
|
|
69
63
|
def construct(
|
|
70
64
|
self,
|
|
71
65
|
graph_name: str,
|
|
72
|
-
nodes: Union[DataFrame,
|
|
73
|
-
relationships: Optional[Union[DataFrame,
|
|
66
|
+
nodes: Union[DataFrame, list[DataFrame]],
|
|
67
|
+
relationships: Optional[Union[DataFrame, list[DataFrame]]] = None,
|
|
74
68
|
concurrency: int = 4,
|
|
75
|
-
undirected_relationship_types: Optional[
|
|
69
|
+
undirected_relationship_types: Optional[list[str]] = None,
|
|
76
70
|
) -> Graph:
|
|
77
|
-
nodes = nodes if isinstance(nodes,
|
|
71
|
+
nodes = nodes if isinstance(nodes, list) else [nodes]
|
|
78
72
|
|
|
79
73
|
if isinstance(relationships, DataFrame):
|
|
80
74
|
relationships = [relationships]
|
|
@@ -244,6 +238,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
244
238
|
params = CallParameters(
|
|
245
239
|
graph_name=graph_name, node_count=node_count, average_degree=average_degree, config=config
|
|
246
240
|
)
|
|
241
|
+
params.ensure_job_id_in_config()
|
|
247
242
|
|
|
248
243
|
result = self._query_runner.call_procedure(
|
|
249
244
|
endpoint=self._namespace,
|
|
@@ -270,6 +265,8 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
270
265
|
relationship_filter=relationship_filter,
|
|
271
266
|
config=config,
|
|
272
267
|
)
|
|
268
|
+
params.ensure_job_id_in_config()
|
|
269
|
+
|
|
273
270
|
result = self._query_runner.call_procedure(
|
|
274
271
|
endpoint=self._namespace,
|
|
275
272
|
logging=True,
|
|
@@ -299,7 +296,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
299
296
|
failIfMissing: bool = False,
|
|
300
297
|
dbName: str = "",
|
|
301
298
|
username: Optional[str] = None,
|
|
302
|
-
) -> Optional[
|
|
299
|
+
) -> Optional[Series[Any]]:
|
|
303
300
|
self._namespace += ".drop"
|
|
304
301
|
|
|
305
302
|
if isinstance(graph, Graph):
|
|
@@ -322,7 +319,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
322
319
|
|
|
323
320
|
return None
|
|
324
321
|
|
|
325
|
-
def exists(self, graph_name: str) ->
|
|
322
|
+
def exists(self, graph_name: str) -> Series[Any]:
|
|
326
323
|
self._namespace += ".exists"
|
|
327
324
|
result = self._query_runner.call_procedure(
|
|
328
325
|
endpoint=self._namespace,
|
|
@@ -331,13 +328,17 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
331
328
|
|
|
332
329
|
return result.squeeze() # type: ignore
|
|
333
330
|
|
|
334
|
-
|
|
335
|
-
def list(self, G: Optional[Graph] = None) -> DataFrame:
|
|
331
|
+
def list(self, G: Optional[Union[Graph, str]] = None) -> DataFrame:
|
|
336
332
|
self._namespace += ".list"
|
|
337
333
|
|
|
334
|
+
if isinstance(G, Graph):
|
|
335
|
+
graph_name = G.name()
|
|
336
|
+
elif isinstance(G, str):
|
|
337
|
+
graph_name = G
|
|
338
|
+
|
|
338
339
|
params = CallParameters()
|
|
339
340
|
if G:
|
|
340
|
-
params["graph_name"] =
|
|
341
|
+
params["graph_name"] = graph_name
|
|
341
342
|
|
|
342
343
|
return self._query_runner.call_procedure(
|
|
343
344
|
endpoint=self._namespace,
|
|
@@ -365,7 +366,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
365
366
|
G: Graph,
|
|
366
367
|
properties: Strings,
|
|
367
368
|
entities: Strings,
|
|
368
|
-
config:
|
|
369
|
+
config: dict[str, Any],
|
|
369
370
|
) -> DataFrame:
|
|
370
371
|
params = CallParameters(
|
|
371
372
|
graph_name=G.name(),
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_alpha_proc_runner.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import os
|
|
2
|
-
from typing import
|
|
2
|
+
from typing import Optional, Union
|
|
3
3
|
|
|
4
4
|
from pandas import DataFrame
|
|
5
5
|
|
|
@@ -36,13 +36,13 @@ class GraphAlphaProcRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
36
36
|
def construct(
|
|
37
37
|
self,
|
|
38
38
|
graph_name: str,
|
|
39
|
-
nodes: Union[DataFrame,
|
|
40
|
-
relationships: Union[DataFrame,
|
|
39
|
+
nodes: Union[DataFrame, list[DataFrame]],
|
|
40
|
+
relationships: Union[DataFrame, list[DataFrame]],
|
|
41
41
|
concurrency: int = 4,
|
|
42
|
-
undirected_relationship_types: Optional[
|
|
42
|
+
undirected_relationship_types: Optional[list[str]] = None,
|
|
43
43
|
) -> Graph:
|
|
44
|
-
nodes = nodes if isinstance(nodes,
|
|
45
|
-
relationships = relationships if isinstance(relationships,
|
|
44
|
+
nodes = nodes if isinstance(nodes, list) else [nodes]
|
|
45
|
+
relationships = relationships if isinstance(relationships, list) else [relationships]
|
|
46
46
|
|
|
47
47
|
errors = []
|
|
48
48
|
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_beta_proc_runner.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any,
|
|
1
|
+
from typing import Any, Union
|
|
2
2
|
|
|
3
3
|
from ..call_parameters import CallParameters
|
|
4
4
|
from ..error.illegal_attr_checker import IllegalAttrChecker
|
|
@@ -9,7 +9,7 @@ from .graph_export_runner import GraphExportCsvEndpoints
|
|
|
9
9
|
from .graph_object import Graph
|
|
10
10
|
from .graph_project_runner import GraphProjectBetaRunner
|
|
11
11
|
|
|
12
|
-
Strings = Union[str,
|
|
12
|
+
Strings = Union[str, list[str]]
|
|
13
13
|
|
|
14
14
|
|
|
15
15
|
class GraphBetaProcRunner(UncallableNamespace, IllegalAttrChecker):
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_cypher_runner.py
RENAMED
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
import re
|
|
4
4
|
from itertools import chain, zip_longest
|
|
5
|
-
from typing import Any,
|
|
5
|
+
from typing import Any, Optional
|
|
6
6
|
|
|
7
7
|
from pandas import Series
|
|
8
8
|
|
|
@@ -45,7 +45,7 @@ class GraphCypherRunner(CallerBase):
|
|
|
45
45
|
|
|
46
46
|
GraphCypherRunner._verify_query_ends_with_return_clause(self._namespace, query)
|
|
47
47
|
|
|
48
|
-
result: Optional[
|
|
48
|
+
result: Optional[dict[str, Any]] = self._query_runner.run_cypher(query, params, database, False).squeeze()
|
|
49
49
|
|
|
50
50
|
if not result:
|
|
51
51
|
raise ValueError("Projected graph cannot be empty.")
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_entity_ops_runner.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from functools import reduce
|
|
2
|
-
from typing import Any,
|
|
2
|
+
from typing import Any, Type, Union
|
|
3
3
|
from warnings import filterwarnings
|
|
4
4
|
|
|
5
5
|
import pandas as pd
|
|
@@ -18,7 +18,7 @@ from ..utils.util_proc_runner import UtilProcRunner
|
|
|
18
18
|
from .graph_object import Graph
|
|
19
19
|
from .graph_type_check import graph_type_check
|
|
20
20
|
|
|
21
|
-
Strings = Union[str,
|
|
21
|
+
Strings = Union[str, list[str]]
|
|
22
22
|
|
|
23
23
|
|
|
24
24
|
class TopologyDataFrame(DataFrame):
|
|
@@ -26,7 +26,7 @@ class TopologyDataFrame(DataFrame):
|
|
|
26
26
|
def _constructor(self) -> "Type[TopologyDataFrame]":
|
|
27
27
|
return TopologyDataFrame
|
|
28
28
|
|
|
29
|
-
def by_rel_type(self) ->
|
|
29
|
+
def by_rel_type(self) -> dict[str, list[list[int]]]:
|
|
30
30
|
# Pandas 2.2.0 deprecated an internal API used by DF.take(indices)
|
|
31
31
|
filterwarnings(
|
|
32
32
|
"ignore",
|
|
@@ -38,7 +38,7 @@ class TopologyDataFrame(DataFrame):
|
|
|
38
38
|
|
|
39
39
|
output = {}
|
|
40
40
|
for rel_type, indices in gb.groups.items():
|
|
41
|
-
one_rel_df = self.take(indices)
|
|
41
|
+
one_rel_df = self.take(list(indices))
|
|
42
42
|
output[str(rel_type)] = [list(one_rel_df["sourceNodeId"]), list(one_rel_df["targetNodeId"])]
|
|
43
43
|
|
|
44
44
|
return output
|
|
@@ -55,7 +55,7 @@ class GraphEntityOpsBaseRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
55
55
|
G: Graph,
|
|
56
56
|
properties: Strings,
|
|
57
57
|
entities: Strings,
|
|
58
|
-
config:
|
|
58
|
+
config: dict[str, Any],
|
|
59
59
|
) -> DataFrame:
|
|
60
60
|
params = CallParameters(
|
|
61
61
|
graph_name=G.name(),
|
|
@@ -78,11 +78,16 @@ class GraphNodePropertyRunner(GraphEntityOpsBaseRunner):
|
|
|
78
78
|
G: Graph,
|
|
79
79
|
node_property: str,
|
|
80
80
|
node_labels: Strings = ["*"],
|
|
81
|
-
db_node_properties:
|
|
81
|
+
db_node_properties: list[str] = [],
|
|
82
82
|
**config: Any,
|
|
83
83
|
) -> DataFrame:
|
|
84
84
|
self._namespace += ".stream"
|
|
85
85
|
|
|
86
|
+
if len(set(db_node_properties)) != len(db_node_properties):
|
|
87
|
+
raise ValueError(
|
|
88
|
+
f"The provided db_node_properties contain duplicate property names: `{db_node_properties}`."
|
|
89
|
+
)
|
|
90
|
+
|
|
86
91
|
result = self._handle_properties(G, node_property, node_labels, config)
|
|
87
92
|
|
|
88
93
|
return GraphNodePropertiesRunner._process_result(
|
|
@@ -96,14 +101,25 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
96
101
|
def stream(
|
|
97
102
|
self,
|
|
98
103
|
G: Graph,
|
|
99
|
-
node_properties:
|
|
104
|
+
node_properties: Union[str, list[str]],
|
|
100
105
|
node_labels: Strings = ["*"],
|
|
101
106
|
separate_property_columns: bool = False,
|
|
102
|
-
db_node_properties:
|
|
107
|
+
db_node_properties: list[str] = [],
|
|
103
108
|
**config: Any,
|
|
104
109
|
) -> DataFrame:
|
|
105
110
|
self._namespace += ".stream"
|
|
106
111
|
|
|
112
|
+
if isinstance(node_properties, str):
|
|
113
|
+
node_properties = [node_properties]
|
|
114
|
+
|
|
115
|
+
# find if list contain duplicates
|
|
116
|
+
if len(set(node_properties)) != len(node_properties):
|
|
117
|
+
raise ValueError(f"The provided node_properties contain duplicate property names: `{node_properties}`.")
|
|
118
|
+
if len(set(db_node_properties)) != len(db_node_properties):
|
|
119
|
+
raise ValueError(
|
|
120
|
+
f"The provided db_node_properties contain duplicate property names: `{db_node_properties}`."
|
|
121
|
+
)
|
|
122
|
+
|
|
107
123
|
result = self._handle_properties(G, node_properties, node_labels, config)
|
|
108
124
|
|
|
109
125
|
return GraphNodePropertiesRunner._process_result(
|
|
@@ -113,11 +129,11 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
113
129
|
@staticmethod
|
|
114
130
|
def _process_result(
|
|
115
131
|
query_runner: QueryRunner,
|
|
116
|
-
node_properties:
|
|
132
|
+
node_properties: list[str],
|
|
117
133
|
separate_property_columns: bool,
|
|
118
|
-
db_node_properties:
|
|
134
|
+
db_node_properties: list[str],
|
|
119
135
|
result: DataFrame,
|
|
120
|
-
config:
|
|
136
|
+
config: dict[str, Any],
|
|
121
137
|
) -> DataFrame:
|
|
122
138
|
# new format was requested, but the query was run via Cypher
|
|
123
139
|
if separate_property_columns and "propertyValue" in result.keys():
|
|
@@ -125,7 +141,11 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
125
141
|
if "listNodeLabels" in config.keys():
|
|
126
142
|
# nodeLabels cannot be an index column of the pivot as its not hashable
|
|
127
143
|
# so we need to manually join it back in
|
|
128
|
-
labels_df = result[["nodeId", "nodeLabels"]]
|
|
144
|
+
labels_df = result[["nodeId", "nodeLabels"]]
|
|
145
|
+
# drop duplicates as for each property we would have one row for each nodeId
|
|
146
|
+
labels_df = labels_df.drop_duplicates(ignore_index=False, subset=["nodeId"])
|
|
147
|
+
labels_df.set_index("nodeId", inplace=True)
|
|
148
|
+
|
|
129
149
|
wide_result = wide_result.join(labels_df, on="nodeId")
|
|
130
150
|
result = wide_result.reset_index()
|
|
131
151
|
result.columns.name = None
|
|
@@ -161,7 +181,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
161
181
|
return result
|
|
162
182
|
|
|
163
183
|
@staticmethod
|
|
164
|
-
def _build_query(db_node_properties:
|
|
184
|
+
def _build_query(db_node_properties: list[str]) -> str:
|
|
165
185
|
query_prefix = "MATCH (n) WHERE id(n) IN $ids RETURN id(n) AS nodeId"
|
|
166
186
|
|
|
167
187
|
def add_property(query: str, prop: str) -> str:
|
|
@@ -176,7 +196,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
176
196
|
|
|
177
197
|
@compatible_with("drop", min_inclusive=ServerVersion(2, 2, 0))
|
|
178
198
|
@graph_type_check
|
|
179
|
-
def drop(self, G: Graph, node_properties:
|
|
199
|
+
def drop(self, G: Graph, node_properties: list[str], **config: Any) -> "Series[Any]":
|
|
180
200
|
self._namespace += ".drop"
|
|
181
201
|
params = CallParameters(
|
|
182
202
|
graph_name=G.name(),
|
|
@@ -205,7 +225,7 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
205
225
|
def stream(
|
|
206
226
|
self,
|
|
207
227
|
G: Graph,
|
|
208
|
-
relationship_properties:
|
|
228
|
+
relationship_properties: list[str],
|
|
209
229
|
relationship_types: Strings = ["*"],
|
|
210
230
|
separate_property_columns: bool = False,
|
|
211
231
|
**config: Any,
|
|
@@ -239,7 +259,7 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
239
259
|
self,
|
|
240
260
|
G: Graph,
|
|
241
261
|
relationship_type: str,
|
|
242
|
-
relationship_properties:
|
|
262
|
+
relationship_properties: list[str],
|
|
243
263
|
**config: Any,
|
|
244
264
|
) -> "Series[Any]":
|
|
245
265
|
self._namespace += ".write"
|
|
@@ -319,7 +339,7 @@ class GraphRelationshipsRunner(GraphEntityOpsBaseRunner):
|
|
|
319
339
|
|
|
320
340
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 5, 0))
|
|
321
341
|
@graph_type_check
|
|
322
|
-
def stream(self, G: Graph, relationship_types:
|
|
342
|
+
def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
|
|
323
343
|
self._namespace += ".stream"
|
|
324
344
|
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
|
|
325
345
|
result = self._query_runner.call_procedure(endpoint=self._namespace, params=params)
|
|
@@ -336,7 +356,7 @@ class GraphRelationshipsRunner(GraphEntityOpsBaseRunner):
|
|
|
336
356
|
class GraphRelationshipsBetaRunner(GraphEntityOpsBaseRunner):
|
|
337
357
|
@compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
|
|
338
358
|
@graph_type_check
|
|
339
|
-
def stream(self, G: Graph, relationship_types:
|
|
359
|
+
def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
|
|
340
360
|
self._namespace += ".stream"
|
|
341
361
|
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
|
|
342
362
|
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_export_runner.py
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
from typing import Any
|
|
1
|
+
from typing import Any
|
|
2
2
|
|
|
3
3
|
from pandas import Series
|
|
4
4
|
|
|
@@ -15,7 +15,7 @@ class GraphExportCsvRunner(IllegalAttrChecker):
|
|
|
15
15
|
return self._export_call(G, config)
|
|
16
16
|
|
|
17
17
|
@graph_type_check
|
|
18
|
-
def _export_call(self, G: Graph, config:
|
|
18
|
+
def _export_call(self, G: Graph, config: dict[str, Any]) -> "Series[Any]":
|
|
19
19
|
params = CallParameters(graph_name=G.name(), config=config)
|
|
20
20
|
return self._query_runner.call_procedure(endpoint=self._namespace, params=params).squeeze() # type: ignore
|
|
21
21
|
|
|
@@ -39,7 +39,7 @@ class GraphExportRunner(IllegalAttrChecker):
|
|
|
39
39
|
return self._export_call(G, config)
|
|
40
40
|
|
|
41
41
|
@graph_type_check
|
|
42
|
-
def _export_call(self, G: Graph, config:
|
|
42
|
+
def _export_call(self, G: Graph, config: dict[str, Any]) -> "Series[Any]":
|
|
43
43
|
params = CallParameters(graph_name=G.name(), config=config)
|
|
44
44
|
return self._query_runner.call_procedure(endpoint=self._namespace, params=params).squeeze() # type: ignore
|
|
45
45
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from types import TracebackType
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Type, Union
|
|
5
5
|
|
|
6
6
|
from pandas import Series
|
|
7
7
|
|
|
@@ -39,7 +39,7 @@ class Graph:
|
|
|
39
39
|
"""
|
|
40
40
|
return self._name
|
|
41
41
|
|
|
42
|
-
def _graph_info(self, yields:
|
|
42
|
+
def _graph_info(self, yields: list[str] = []) -> Series[Any]:
|
|
43
43
|
yield_db = "database" in yields
|
|
44
44
|
yields_with_db = yields if yield_db else yields + ["database"]
|
|
45
45
|
|
|
@@ -90,21 +90,21 @@ class Graph:
|
|
|
90
90
|
"""
|
|
91
91
|
return self._graph_info(["relationshipCount"]) # type: ignore
|
|
92
92
|
|
|
93
|
-
def node_labels(self) ->
|
|
93
|
+
def node_labels(self) -> list[str]:
|
|
94
94
|
"""
|
|
95
95
|
Returns:
|
|
96
96
|
the node labels in the graph
|
|
97
97
|
"""
|
|
98
98
|
return list(self._graph_info(["schema"])["nodes"].keys())
|
|
99
99
|
|
|
100
|
-
def relationship_types(self) ->
|
|
100
|
+
def relationship_types(self) -> list[str]:
|
|
101
101
|
"""
|
|
102
102
|
Returns:
|
|
103
103
|
the relationship types in the graph
|
|
104
104
|
"""
|
|
105
105
|
return list(self._graph_info(["schema"])["relationships"].keys())
|
|
106
106
|
|
|
107
|
-
def node_properties(self, label: Optional[str] = None) -> Union[
|
|
107
|
+
def node_properties(self, label: Optional[str] = None) -> Union[Series[str], list[str]]:
|
|
108
108
|
"""
|
|
109
109
|
Args:
|
|
110
110
|
label: the node label to get the properties for
|
|
@@ -123,7 +123,7 @@ class Graph:
|
|
|
123
123
|
|
|
124
124
|
return list(labels_to_props[label].keys())
|
|
125
125
|
|
|
126
|
-
def relationship_properties(self, type: Optional[str] = None) -> Union[
|
|
126
|
+
def relationship_properties(self, type: Optional[str] = None) -> Union[Series[str], list[str]]:
|
|
127
127
|
"""
|
|
128
128
|
Args:
|
|
129
129
|
type: the relationship type to get the properties for
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
from typing import
|
|
3
|
+
from typing import Optional
|
|
4
4
|
|
|
5
5
|
from ..call_parameters import CallParameters
|
|
6
6
|
from ..error.illegal_attr_checker import IllegalAttrChecker
|
|
@@ -17,10 +17,12 @@ class GraphProjectRemoteRunner(IllegalAttrChecker):
|
|
|
17
17
|
self,
|
|
18
18
|
graph_name: str,
|
|
19
19
|
query: str,
|
|
20
|
+
job_id: Optional[str] = None,
|
|
20
21
|
concurrency: int = 4,
|
|
21
|
-
undirected_relationship_types: Optional[
|
|
22
|
-
inverse_indexed_relationship_types: Optional[
|
|
22
|
+
undirected_relationship_types: Optional[list[str]] = None,
|
|
23
|
+
inverse_indexed_relationship_types: Optional[list[str]] = None,
|
|
23
24
|
batch_size: Optional[int] = None,
|
|
25
|
+
logging: bool = True,
|
|
24
26
|
) -> GraphCreateResult:
|
|
25
27
|
if inverse_indexed_relationship_types is None:
|
|
26
28
|
inverse_indexed_relationship_types = []
|
|
@@ -34,6 +36,7 @@ class GraphProjectRemoteRunner(IllegalAttrChecker):
|
|
|
34
36
|
params = CallParameters(
|
|
35
37
|
graph_name=graph_name,
|
|
36
38
|
query=query,
|
|
39
|
+
job_id=job_id,
|
|
37
40
|
concurrency=concurrency,
|
|
38
41
|
undirected_relationship_types=undirected_relationship_types,
|
|
39
42
|
inverse_indexed_relationship_types=inverse_indexed_relationship_types,
|
|
@@ -43,5 +46,6 @@ class GraphProjectRemoteRunner(IllegalAttrChecker):
|
|
|
43
46
|
result = self._query_runner.call_procedure(
|
|
44
47
|
endpoint=SessionQueryRunner.GDS_REMOTE_PROJECTION_PROC_NAME,
|
|
45
48
|
params=params,
|
|
49
|
+
logging=True,
|
|
46
50
|
).squeeze()
|
|
47
51
|
return GraphCreateResult(Graph(graph_name, self._query_runner), result)
|
{graphdatascience-1.12a1 → graphdatascience-1.14}/graphdatascience/graph/graph_type_check.py
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
from functools import wraps
|
|
2
|
-
from typing import Any, Callable,
|
|
2
|
+
from typing import Any, Callable, TypeVar, cast
|
|
3
3
|
|
|
4
4
|
from .graph_object import Graph
|
|
5
5
|
|
|
@@ -20,20 +20,6 @@ def graph_type_check(func: F) -> F:
|
|
|
20
20
|
return cast(F, wrapper)
|
|
21
21
|
|
|
22
22
|
|
|
23
|
-
def graph_type_check_optional(func: F) -> F:
|
|
24
|
-
@wraps(func)
|
|
25
|
-
def wrapper(self: Any, G: Optional[Graph] = None, *args: Any, **kwargs: Any) -> Any:
|
|
26
|
-
if isinstance(G, str):
|
|
27
|
-
raise TypeError(
|
|
28
|
-
f"The parameter 'G' takes a `Graph` object, but received string '{G}'. "
|
|
29
|
-
"To resolve a graph name string into a `Graph` object, please use `gds.graph.get`"
|
|
30
|
-
)
|
|
31
|
-
|
|
32
|
-
return func(self, G, *args, **kwargs)
|
|
33
|
-
|
|
34
|
-
return cast(F, wrapper)
|
|
35
|
-
|
|
36
|
-
|
|
37
23
|
def from_graph_type_check(func: F) -> F:
|
|
38
24
|
@wraps(func)
|
|
39
25
|
def wrapper(self: Any, graph_name: str, from_G: Graph, *args: Any, **kwargs: Any) -> Any:
|