graphdatascience 1.12__tar.gz → 1.13__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.
Files changed (155) hide show
  1. {graphdatascience-1.12/graphdatascience.egg-info → graphdatascience-1.13}/PKG-INFO +5 -5
  2. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/algo/algo_proc_runner.py +3 -3
  3. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/call_parameters.py +2 -1
  4. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/endpoint_suggester.py +1 -3
  5. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/base_graph_proc_runner.py +9 -16
  6. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_alpha_proc_runner.py +6 -6
  7. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_beta_proc_runner.py +2 -2
  8. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_cypher_runner.py +2 -2
  9. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_entity_ops_runner.py +35 -18
  10. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_export_runner.py +3 -3
  11. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_object.py +6 -6
  12. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_remote_project_runner.py +5 -3
  13. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/nx_loader.py +10 -10
  14. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/ogb_loader.py +24 -30
  15. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph_data_science.py +15 -8
  16. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/link_prediction_model.py +4 -4
  17. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model.py +3 -3
  18. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model_alpha_proc_runner.py +6 -4
  19. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model_proc_runner.py +4 -4
  20. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/node_classification_model.py +4 -4
  21. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/node_regression_model.py +3 -3
  22. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/pipeline_model.py +16 -14
  23. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/simple_rel_embedding_model.py +4 -4
  24. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/lp_pipeline_create_runner.py +2 -2
  25. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/nc_pipeline_create_runner.py +4 -2
  26. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/nc_training_pipeline.py +2 -2
  27. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/nr_training_pipeline.py +2 -2
  28. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/training_pipeline.py +3 -3
  29. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/arrow_endpoint_version.py +2 -3
  30. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/arrow_graph_constructor.py +37 -33
  31. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/arrow_info.py +1 -2
  32. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/arrow_query_runner.py +69 -101
  33. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/cypher_graph_constructor.py +32 -33
  34. graphdatascience-1.13/graphdatascience/query_runner/gds_arrow_client.py +875 -0
  35. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/graph_constructor.py +1 -2
  36. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/neo4j_query_runner.py +97 -28
  37. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/progress/query_progress_logger.py +2 -17
  38. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/progress/static_progress_provider.py +2 -2
  39. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/protocol/project_protocols.py +52 -8
  40. graphdatascience-1.13/graphdatascience/query_runner/protocol/status.py +7 -0
  41. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/protocol/write_protocols.py +49 -11
  42. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/query_runner.py +5 -5
  43. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/session_query_runner.py +13 -12
  44. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/aura_api.py +46 -23
  45. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/aura_api_responses.py +51 -36
  46. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/aura_graph_data_science.py +19 -17
  47. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/cloud_location.py +1 -1
  48. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/dbms/protocol_resolver.py +5 -3
  49. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/dbms/protocol_version.py +1 -6
  50. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/dbms_connection_info.py +2 -2
  51. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/dedicated_sessions.py +52 -38
  52. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/gds_sessions.py +14 -4
  53. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/session_info.py +4 -1
  54. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/session_sizes.py +2 -2
  55. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/system/config_endpoints.py +2 -2
  56. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/system/system_endpoints.py +15 -0
  57. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +2 -2
  58. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/utils/direct_util_endpoints.py +3 -3
  59. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/utils/util_proc_runner.py +2 -2
  60. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/utils/util_remote_proc_runner.py +2 -2
  61. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/version.py +1 -1
  62. {graphdatascience-1.12 → graphdatascience-1.13/graphdatascience.egg-info}/PKG-INFO +5 -5
  63. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience.egg-info/SOURCES.txt +1 -0
  64. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience.egg-info/requires.txt +3 -2
  65. {graphdatascience-1.12 → graphdatascience-1.13}/pyproject.toml +1 -1
  66. {graphdatascience-1.12 → graphdatascience-1.13}/requirements/base/base.txt +2 -1
  67. {graphdatascience-1.12 → graphdatascience-1.13}/requirements/base/rust-ext.txt +1 -1
  68. {graphdatascience-1.12 → graphdatascience-1.13}/setup.py +1 -2
  69. graphdatascience-1.12/graphdatascience/query_runner/gds_arrow_client.py +0 -297
  70. {graphdatascience-1.12 → graphdatascience-1.13}/LICENSE +0 -0
  71. {graphdatascience-1.12 → graphdatascience-1.13}/MANIFEST.in +0 -0
  72. {graphdatascience-1.12 → graphdatascience-1.13}/README.md +0 -0
  73. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/__init__.py +0 -0
  74. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/algo/__init__.py +0 -0
  75. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/algo/algo_endpoints.py +0 -0
  76. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
  77. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/call_builder.py +0 -0
  78. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/caller_base.py +0 -0
  79. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/endpoints.py +0 -0
  80. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/__init__.py +0 -0
  81. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/client_only_endpoint.py +0 -0
  82. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/cypher_warning_handler.py +0 -0
  83. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/gds_not_installed.py +0 -0
  84. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/illegal_attr_checker.py +0 -0
  85. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/unable_to_connect.py +0 -0
  86. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/error/uncallable_namespace.py +0 -0
  87. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/__init__.py +0 -0
  88. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_create_result.py +0 -0
  89. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_endpoints.py +0 -0
  90. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_proc_runner.py +0 -0
  91. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_project_runner.py +0 -0
  92. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
  93. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_sample_runner.py +0 -0
  94. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/graph/graph_type_check.py +0 -0
  95. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/ignored_server_endpoints.py +0 -0
  96. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/__init__.py +0 -0
  97. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/graphsage_model.py +0 -0
  98. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model_beta_proc_runner.py +0 -0
  99. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model_endpoints.py +0 -0
  100. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/model/model_resolver.py +0 -0
  101. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/__init__.py +0 -0
  102. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
  103. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
  104. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
  105. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
  106. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
  107. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
  108. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
  109. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/py.typed +0 -0
  110. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/__init__.py +0 -0
  111. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/progress/__init__.py +0 -0
  112. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/progress/progress_provider.py +0 -0
  113. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/progress/query_progress_provider.py +0 -0
  114. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/query_runner/protocol/__init__.py +0 -0
  115. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/__init__.py +0 -0
  116. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/cora/__init__.py +0 -0
  117. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
  118. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
  119. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/cora/serialize_cora.py +0 -0
  120. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/__init__.py +0 -0
  121. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
  122. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
  123. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
  124. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
  125. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
  126. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
  127. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
  128. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/karate/__init__.py +0 -0
  129. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
  130. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/__init__.py +0 -0
  131. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
  132. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
  133. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
  134. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
  135. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
  136. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
  137. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/server_version/__init__.py +0 -0
  138. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/server_version/compatible_with.py +0 -0
  139. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/server_version/server_version.py +0 -0
  140. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/__init__.py +0 -0
  141. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/algorithm_category.py +0 -0
  142. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/aurads_sessions.py +0 -0
  143. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/dbms/__init__.py +0 -0
  144. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/session/region_suggester.py +0 -0
  145. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/system/__init__.py +0 -0
  146. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/topological_lp/__init__.py +0 -0
  147. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
  148. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/utils/__init__.py +0 -0
  149. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience/utils/util_node_property_func_runner.py +0 -0
  150. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience.egg-info/dependency_links.txt +0 -0
  151. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience.egg-info/not-zip-safe +0 -0
  152. {graphdatascience-1.12 → graphdatascience-1.13}/graphdatascience.egg-info/top_level.txt +0 -0
  153. {graphdatascience-1.12 → graphdatascience-1.13}/requirements/base/networkx.txt +0 -0
  154. {graphdatascience-1.12 → graphdatascience-1.13}/requirements/base/ogb.txt +0 -0
  155. {graphdatascience-1.12 → graphdatascience-1.13}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: graphdatascience
3
- Version: 1.12
3
+ Version: 1.13
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,7 +16,6 @@ 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
@@ -25,24 +24,25 @@ Classifier: Topic :: Database
25
24
  Classifier: Topic :: Scientific/Engineering
26
25
  Classifier: Topic :: Software Development
27
26
  Classifier: Typing :: Typed
28
- Requires-Python: >=3.8
27
+ Requires-Python: >=3.9
29
28
  Description-Content-Type: text/markdown
30
29
  License-File: LICENSE
31
30
  Requires-Dist: multimethod<2.0,>=1.0
32
31
  Requires-Dist: neo4j<6.0,>=4.4.12
33
32
  Requires-Dist: numpy<2.0
34
33
  Requires-Dist: pandas<3.0,>=1.0
35
- Requires-Dist: pyarrow<17.0,>=14.0.1
34
+ Requires-Dist: pyarrow<19.0,>=15.0.2
36
35
  Requires-Dist: textdistance<5.0,>=4.0
37
36
  Requires-Dist: tqdm<5.0,>=4.0
38
37
  Requires-Dist: typing-extensions<5.0,>=4.0
39
38
  Requires-Dist: requests
39
+ Requires-Dist: tenacity>=9.0
40
40
  Provides-Extra: ogb
41
41
  Requires-Dist: ogb<2.0,>=1.0; extra == "ogb"
42
42
  Provides-Extra: networkx
43
43
  Requires-Dist: networkx<4.0,>=2.0; extra == "networkx"
44
44
  Provides-Extra: rust-ext
45
- Requires-Dist: neo4j-rust-ext<6.0,>=4.4.2; extra == "rust-ext"
45
+ Requires-Dist: neo4j-rust-ext<6.0,>=4.4.12; extra == "rust-ext"
46
46
 
47
47
  # Neo4j Graph Data Science Client
48
48
 
@@ -1,5 +1,5 @@
1
1
  from abc import ABC
2
- from typing import Any, Dict, Tuple
2
+ from typing import Any
3
3
 
4
4
  from pandas import DataFrame, Series
5
5
 
@@ -12,7 +12,7 @@ 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: Dict[str, Any], with_logging: bool = True) -> DataFrame:
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
17
 
18
18
  return self._query_runner.call_procedure(endpoint=self._namespace, params=params, logging=with_logging)
@@ -35,7 +35,7 @@ class StandardModeRunner(AlgoProcRunner):
35
35
 
36
36
  class GraphSageRunner(AlgoProcRunner):
37
37
  @graph_type_check
38
- def __call__(self, G: Graph, **config: Any) -> Tuple[GraphSageModel, "Series[Any]"]:
38
+ def __call__(self, G: Graph, **config: Any) -> tuple[GraphSageModel, "Series[Any]"]:
39
39
  result = self._run_procedure(G, config).squeeze()
40
40
  model_name = result["modelInfo"]["modelName"]
41
41
 
@@ -1,4 +1,5 @@
1
- from typing import Any, OrderedDict
1
+ from collections import OrderedDict
2
+ from typing import Any
2
3
 
3
4
 
4
5
  class CallParameters(OrderedDict[str, Any]):
@@ -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: List[str]) -> str:
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
@@ -1,8 +1,7 @@
1
1
  import os
2
2
  import pathlib
3
- import sys
4
3
  import warnings
5
- from typing import Any, Dict, List, Optional, Union
4
+ from typing import Any, List, Optional, Union
6
5
 
7
6
  import pandas as pd
8
7
  from multimethod import multimethod
@@ -53,28 +52,22 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
53
52
 
54
53
  @staticmethod
55
54
  def _path(package: str, resource: str) -> pathlib.Path:
56
- if sys.version_info >= (3, 9):
57
- from importlib.resources import files
55
+ from importlib.resources import files
58
56
 
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
63
-
64
- # we dont want to use a context manager here, so we need to call __enter__ manually
65
- return path(package, resource).__enter__()
57
+ # files() returns a Traversable, but usages require a Path object
58
+ return pathlib.Path(str(files(package) / resource))
66
59
 
67
60
  @client_only_endpoint("gds.graph")
68
61
  @compatible_with("construct", min_inclusive=ServerVersion(2, 1, 0))
69
62
  def construct(
70
63
  self,
71
64
  graph_name: str,
72
- nodes: Union[DataFrame, List[DataFrame]],
73
- relationships: Optional[Union[DataFrame, List[DataFrame]]] = None,
65
+ nodes: Union[DataFrame, list[DataFrame]],
66
+ relationships: Optional[Union[DataFrame, list[DataFrame]]] = None,
74
67
  concurrency: int = 4,
75
- undirected_relationship_types: Optional[List[str]] = None,
68
+ undirected_relationship_types: Optional[list[str]] = None,
76
69
  ) -> Graph:
77
- nodes = nodes if isinstance(nodes, List) else [nodes]
70
+ nodes = nodes if isinstance(nodes, list) else [nodes]
78
71
 
79
72
  if isinstance(relationships, DataFrame):
80
73
  relationships = [relationships]
@@ -365,7 +358,7 @@ class BaseGraphProcRunner(UncallableNamespace, IllegalAttrChecker):
365
358
  G: Graph,
366
359
  properties: Strings,
367
360
  entities: Strings,
368
- config: Dict[str, Any],
361
+ config: dict[str, Any],
369
362
  ) -> DataFrame:
370
363
  params = CallParameters(
371
364
  graph_name=G.name(),
@@ -1,5 +1,5 @@
1
1
  import os
2
- from typing import List, Optional, Union
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, List[DataFrame]],
40
- relationships: Union[DataFrame, List[DataFrame]],
39
+ nodes: Union[DataFrame, list[DataFrame]],
40
+ relationships: Union[DataFrame, list[DataFrame]],
41
41
  concurrency: int = 4,
42
- undirected_relationship_types: Optional[List[str]] = None,
42
+ undirected_relationship_types: Optional[list[str]] = None,
43
43
  ) -> Graph:
44
- nodes = nodes if isinstance(nodes, List) else [nodes]
45
- relationships = relationships if isinstance(relationships, List) else [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
 
@@ -1,4 +1,4 @@
1
- from typing import Any, List, Union
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, List[str]]
12
+ Strings = Union[str, list[str]]
13
13
 
14
14
 
15
15
  class GraphBetaProcRunner(UncallableNamespace, IllegalAttrChecker):
@@ -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, Dict, Optional
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[Dict[str, Any]] = self._query_runner.run_cypher(query, params, database, False).squeeze()
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.")
@@ -1,5 +1,5 @@
1
1
  from functools import reduce
2
- from typing import Any, Dict, List, Type, Union
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, List[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) -> Dict[str, List[List[int]]]:
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: Dict[str, Any],
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: List[str] = [],
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,22 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
96
101
  def stream(
97
102
  self,
98
103
  G: Graph,
99
- node_properties: List[str],
104
+ node_properties: list[str],
100
105
  node_labels: Strings = ["*"],
101
106
  separate_property_columns: bool = False,
102
- db_node_properties: List[str] = [],
107
+ db_node_properties: list[str] = [],
103
108
  **config: Any,
104
109
  ) -> DataFrame:
105
110
  self._namespace += ".stream"
106
111
 
112
+ # find if list contain duplicates
113
+ if len(set(node_properties)) != len(node_properties):
114
+ raise ValueError(f"The provided node_properties contain duplicate property names: `{node_properties}`.")
115
+ if len(set(db_node_properties)) != len(db_node_properties):
116
+ raise ValueError(
117
+ f"The provided db_node_properties contain duplicate property names: `{db_node_properties}`."
118
+ )
119
+
107
120
  result = self._handle_properties(G, node_properties, node_labels, config)
108
121
 
109
122
  return GraphNodePropertiesRunner._process_result(
@@ -113,11 +126,11 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
113
126
  @staticmethod
114
127
  def _process_result(
115
128
  query_runner: QueryRunner,
116
- node_properties: List[str],
129
+ node_properties: list[str],
117
130
  separate_property_columns: bool,
118
- db_node_properties: List[str],
131
+ db_node_properties: list[str],
119
132
  result: DataFrame,
120
- config: Dict[str, Any],
133
+ config: dict[str, Any],
121
134
  ) -> DataFrame:
122
135
  # new format was requested, but the query was run via Cypher
123
136
  if separate_property_columns and "propertyValue" in result.keys():
@@ -125,7 +138,11 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
125
138
  if "listNodeLabels" in config.keys():
126
139
  # nodeLabels cannot be an index column of the pivot as its not hashable
127
140
  # so we need to manually join it back in
128
- labels_df = result[["nodeId", "nodeLabels"]].set_index("nodeId")
141
+ labels_df = result[["nodeId", "nodeLabels"]]
142
+ # drop duplicates as for each property we would have one row for each nodeId
143
+ labels_df = labels_df.drop_duplicates(ignore_index=False, subset=["nodeId"])
144
+ labels_df.set_index("nodeId", inplace=True)
145
+
129
146
  wide_result = wide_result.join(labels_df, on="nodeId")
130
147
  result = wide_result.reset_index()
131
148
  result.columns.name = None
@@ -161,7 +178,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
161
178
  return result
162
179
 
163
180
  @staticmethod
164
- def _build_query(db_node_properties: List[str]) -> str:
181
+ def _build_query(db_node_properties: list[str]) -> str:
165
182
  query_prefix = "MATCH (n) WHERE id(n) IN $ids RETURN id(n) AS nodeId"
166
183
 
167
184
  def add_property(query: str, prop: str) -> str:
@@ -176,7 +193,7 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
176
193
 
177
194
  @compatible_with("drop", min_inclusive=ServerVersion(2, 2, 0))
178
195
  @graph_type_check
179
- def drop(self, G: Graph, node_properties: List[str], **config: Any) -> "Series[Any]":
196
+ def drop(self, G: Graph, node_properties: list[str], **config: Any) -> "Series[Any]":
180
197
  self._namespace += ".drop"
181
198
  params = CallParameters(
182
199
  graph_name=G.name(),
@@ -205,7 +222,7 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
205
222
  def stream(
206
223
  self,
207
224
  G: Graph,
208
- relationship_properties: List[str],
225
+ relationship_properties: list[str],
209
226
  relationship_types: Strings = ["*"],
210
227
  separate_property_columns: bool = False,
211
228
  **config: Any,
@@ -239,7 +256,7 @@ class GraphRelationshipPropertiesRunner(GraphEntityOpsBaseRunner):
239
256
  self,
240
257
  G: Graph,
241
258
  relationship_type: str,
242
- relationship_properties: List[str],
259
+ relationship_properties: list[str],
243
260
  **config: Any,
244
261
  ) -> "Series[Any]":
245
262
  self._namespace += ".write"
@@ -319,7 +336,7 @@ class GraphRelationshipsRunner(GraphEntityOpsBaseRunner):
319
336
 
320
337
  @compatible_with("stream", min_inclusive=ServerVersion(2, 5, 0))
321
338
  @graph_type_check
322
- def stream(self, G: Graph, relationship_types: List[str] = ["*"], **config: Any) -> TopologyDataFrame:
339
+ def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
323
340
  self._namespace += ".stream"
324
341
  params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
325
342
  result = self._query_runner.call_procedure(endpoint=self._namespace, params=params)
@@ -336,7 +353,7 @@ class GraphRelationshipsRunner(GraphEntityOpsBaseRunner):
336
353
  class GraphRelationshipsBetaRunner(GraphEntityOpsBaseRunner):
337
354
  @compatible_with("stream", min_inclusive=ServerVersion(2, 2, 0))
338
355
  @graph_type_check
339
- def stream(self, G: Graph, relationship_types: List[str] = ["*"], **config: Any) -> TopologyDataFrame:
356
+ def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
340
357
  self._namespace += ".stream"
341
358
  params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
342
359
 
@@ -1,4 +1,4 @@
1
- from typing import Any, Dict
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: Dict[str, Any]) -> "Series[Any]":
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: Dict[str, Any]) -> "Series[Any]":
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, List, Optional, Type, Union
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: List[str] = []) -> "Series[Any]":
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) -> List[str]:
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) -> List[str]:
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["Series[str]", List[str]]:
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["Series[str]", List[str]]:
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 List, Optional
3
+ from typing import Optional
4
4
 
5
5
  from ..call_parameters import CallParameters
6
6
  from ..error.illegal_attr_checker import IllegalAttrChecker
@@ -17,9 +17,10 @@ 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[List[str]] = None,
22
- inverse_indexed_relationship_types: Optional[List[str]] = None,
22
+ undirected_relationship_types: Optional[list[str]] = None,
23
+ inverse_indexed_relationship_types: Optional[list[str]] = None,
23
24
  batch_size: Optional[int] = None,
24
25
  ) -> GraphCreateResult:
25
26
  if inverse_indexed_relationship_types is None:
@@ -34,6 +35,7 @@ class GraphProjectRemoteRunner(IllegalAttrChecker):
34
35
  params = CallParameters(
35
36
  graph_name=graph_name,
36
37
  query=query,
38
+ job_id=job_id,
37
39
  concurrency=concurrency,
38
40
  undirected_relationship_types=undirected_relationship_types,
39
41
  inverse_indexed_relationship_types=inverse_indexed_relationship_types,
@@ -1,5 +1,5 @@
1
1
  from collections import defaultdict
2
- from typing import Any, Dict, List, Optional, Set, Tuple
2
+ from typing import Any, Optional
3
3
 
4
4
  import networkx as nx
5
5
  from pandas import DataFrame
@@ -28,8 +28,8 @@ class NXLoader(UncallableNamespace, IllegalAttrChecker):
28
28
  return Graph(graph_name, self._query_runner)
29
29
 
30
30
  @staticmethod
31
- def _attr_to_labels_key(labels_attr: Any, node_id: Any, no_node_labels: Optional[bool]) -> Tuple[str, ...]:
32
- node_labels: List[str]
31
+ def _attr_to_labels_key(labels_attr: Any, node_id: Any, no_node_labels: Optional[bool]) -> tuple[str, ...]:
32
+ node_labels: list[str]
33
33
  if no_node_labels:
34
34
  node_labels = ["N"]
35
35
  elif isinstance(labels_attr, str):
@@ -45,9 +45,9 @@ class NXLoader(UncallableNamespace, IllegalAttrChecker):
45
45
  return tuple(sorted(node_labels))
46
46
 
47
47
  @staticmethod
48
- def _parse_nodes(nx_G: nx.Graph) -> List[DataFrame]:
49
- node_dicts_by_labels: Dict[Tuple[str, ...], Dict[str, List[Any]]] = defaultdict(lambda: defaultdict(list))
50
- node_props_schema: Dict[Tuple[str, ...], Set[str]] = defaultdict(set)
48
+ def _parse_nodes(nx_G: nx.Graph) -> list[DataFrame]:
49
+ node_dicts_by_labels: dict[tuple[str, ...], dict[str, list[Any]]] = defaultdict(lambda: defaultdict(list))
50
+ node_props_schema: dict[tuple[str, ...], set[str]] = defaultdict(set)
51
51
 
52
52
  no_node_labels = None
53
53
 
@@ -84,9 +84,9 @@ class NXLoader(UncallableNamespace, IllegalAttrChecker):
84
84
  return "R" if type_attr is None else type_attr
85
85
 
86
86
  @staticmethod
87
- def _parse_rels(nx_G: nx.Graph) -> List[DataFrame]:
88
- rel_dicts_by_types: Dict[str, Dict[str, List[Any]]] = defaultdict(lambda: defaultdict(list))
89
- rel_props_schema: Dict[str, Set[str]] = defaultdict(set)
87
+ def _parse_rels(nx_G: nx.Graph) -> list[DataFrame]:
88
+ rel_dicts_by_types: dict[str, dict[str, list[Any]]] = defaultdict(lambda: defaultdict(list))
89
+ rel_props_schema: dict[str, set[str]] = defaultdict(set)
90
90
  no_rel_types = None
91
91
 
92
92
  for edge_data in nx_G.edges(data=True):
@@ -129,7 +129,7 @@ class NXLoader(UncallableNamespace, IllegalAttrChecker):
129
129
  ]
130
130
 
131
131
  @staticmethod
132
- def _parse(nx_G: nx.Graph) -> Tuple[List[DataFrame], List[DataFrame]]:
132
+ def _parse(nx_G: nx.Graph) -> tuple[list[DataFrame], list[DataFrame]]:
133
133
  nodes = NXLoader._parse_nodes(nx_G)
134
134
  rels = NXLoader._parse_rels(nx_G)
135
135