graphdatascience 1.14__tar.gz → 1.15a1__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 (160) hide show
  1. {graphdatascience-1.14/graphdatascience.egg-info → graphdatascience-1.15a1}/PKG-INFO +3 -2
  2. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/arrow_query_runner.py +4 -0
  3. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/gds_arrow_client.py +117 -28
  4. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/protocol/project_protocols.py +2 -1
  5. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/protocol/write_protocols.py +2 -1
  6. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/termination_flag.py +3 -4
  7. graphdatascience-1.15a1/graphdatascience/retry_utils/retry_config.py +12 -0
  8. {graphdatascience-1.14/graphdatascience/query_runner/protocol → graphdatascience-1.15a1/graphdatascience/retry_utils}/retry_utils.py +5 -4
  9. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/aura_api.py +13 -5
  10. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/dedicated_sessions.py +4 -10
  11. graphdatascience-1.15a1/graphdatascience/utils/__init__.py +0 -0
  12. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/version.py +1 -1
  13. {graphdatascience-1.14 → graphdatascience-1.15a1/graphdatascience.egg-info}/PKG-INFO +3 -2
  14. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience.egg-info/SOURCES.txt +3 -1
  15. {graphdatascience-1.14 → graphdatascience-1.15a1}/LICENSE +0 -0
  16. {graphdatascience-1.14 → graphdatascience-1.15a1}/MANIFEST.in +0 -0
  17. {graphdatascience-1.14 → graphdatascience-1.15a1}/README.md +0 -0
  18. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/__init__.py +0 -0
  19. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/algo/__init__.py +0 -0
  20. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/algo/algo_endpoints.py +0 -0
  21. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/algo/algo_proc_runner.py +0 -0
  22. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
  23. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/call_builder.py +0 -0
  24. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/call_parameters.py +0 -0
  25. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/caller_base.py +0 -0
  26. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/endpoints.py +0 -0
  27. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/__init__.py +0 -0
  28. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/client_only_endpoint.py +0 -0
  29. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/cypher_warning_handler.py +0 -0
  30. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/endpoint_suggester.py +0 -0
  31. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/gds_not_installed.py +0 -0
  32. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/illegal_attr_checker.py +0 -0
  33. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/unable_to_connect.py +0 -0
  34. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/error/uncallable_namespace.py +0 -0
  35. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/__init__.py +0 -0
  36. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/base_graph_proc_runner.py +0 -0
  37. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_alpha_proc_runner.py +0 -0
  38. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_beta_proc_runner.py +0 -0
  39. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_create_result.py +0 -0
  40. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_cypher_runner.py +0 -0
  41. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_endpoints.py +0 -0
  42. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_entity_ops_runner.py +0 -0
  43. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_export_runner.py +0 -0
  44. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_object.py +0 -0
  45. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_proc_runner.py +0 -0
  46. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_project_runner.py +0 -0
  47. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
  48. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_remote_project_runner.py +0 -0
  49. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_sample_runner.py +0 -0
  50. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/graph_type_check.py +0 -0
  51. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/nx_loader.py +0 -0
  52. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph/ogb_loader.py +0 -0
  53. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/graph_data_science.py +0 -0
  54. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/ignored_server_endpoints.py +0 -0
  55. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/__init__.py +0 -0
  56. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/graphsage_model.py +0 -0
  57. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/link_prediction_model.py +0 -0
  58. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model.py +0 -0
  59. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model_alpha_proc_runner.py +0 -0
  60. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model_beta_proc_runner.py +0 -0
  61. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model_endpoints.py +0 -0
  62. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model_proc_runner.py +0 -0
  63. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/model_resolver.py +0 -0
  64. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/node_classification_model.py +0 -0
  65. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/node_regression_model.py +0 -0
  66. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/pipeline_model.py +0 -0
  67. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/model/simple_rel_embedding_model.py +0 -0
  68. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/__init__.py +0 -0
  69. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
  70. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -0
  71. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
  72. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -0
  73. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/nc_training_pipeline.py +0 -0
  74. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
  75. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/nr_training_pipeline.py +0 -0
  76. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
  77. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
  78. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
  79. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
  80. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/pipeline/training_pipeline.py +0 -0
  81. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/py.typed +0 -0
  82. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/__init__.py +0 -0
  83. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/arrow_endpoint_version.py +0 -0
  84. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/arrow_graph_constructor.py +0 -0
  85. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/arrow_info.py +0 -0
  86. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/cypher_graph_constructor.py +0 -0
  87. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/graph_constructor.py +0 -0
  88. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/neo4j_query_runner.py +0 -0
  89. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/progress/__init__.py +0 -0
  90. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/progress/progress_provider.py +0 -0
  91. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/progress/query_progress_logger.py +0 -0
  92. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/progress/query_progress_provider.py +0 -0
  93. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/progress/static_progress_provider.py +0 -0
  94. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/protocol/__init__.py +0 -0
  95. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/protocol/status.py +0 -0
  96. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/query_runner.py +0 -0
  97. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/query_runner/session_query_runner.py +0 -0
  98. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/__init__.py +0 -0
  99. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/cora/__init__.py +0 -0
  100. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
  101. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
  102. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/cora/serialize_cora.py +0 -0
  103. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/__init__.py +0 -0
  104. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
  105. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
  106. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
  107. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
  108. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
  109. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
  110. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
  111. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/karate/__init__.py +0 -0
  112. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
  113. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/__init__.py +0 -0
  114. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
  115. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
  116. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
  117. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
  118. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
  119. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
  120. {graphdatascience-1.14/graphdatascience/semantic_version → graphdatascience-1.15a1/graphdatascience/retry_utils}/__init__.py +0 -0
  121. {graphdatascience-1.14/graphdatascience/server_version → graphdatascience-1.15a1/graphdatascience/semantic_version}/__init__.py +0 -0
  122. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/semantic_version/semantic_version.py +0 -0
  123. {graphdatascience-1.14/graphdatascience/session/dbms → graphdatascience-1.15a1/graphdatascience/server_version}/__init__.py +0 -0
  124. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/server_version/compatible_with.py +0 -0
  125. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/server_version/server_version.py +0 -0
  126. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/__init__.py +0 -0
  127. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/algorithm_category.py +0 -0
  128. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/aura_api_responses.py +0 -0
  129. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/aura_graph_data_science.py +0 -0
  130. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/aurads_sessions.py +0 -0
  131. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/cloud_location.py +0 -0
  132. {graphdatascience-1.14/graphdatascience/system → graphdatascience-1.15a1/graphdatascience/session/dbms}/__init__.py +0 -0
  133. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/dbms/protocol_resolver.py +0 -0
  134. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/dbms/protocol_version.py +0 -0
  135. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/dbms_connection_info.py +0 -0
  136. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/gds_sessions.py +0 -0
  137. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/region_suggester.py +0 -0
  138. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/session_info.py +0 -0
  139. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/session/session_sizes.py +0 -0
  140. {graphdatascience-1.14/graphdatascience/topological_lp → graphdatascience-1.15a1/graphdatascience/system}/__init__.py +0 -0
  141. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/system/config_endpoints.py +0 -0
  142. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/system/system_endpoints.py +0 -0
  143. {graphdatascience-1.14/graphdatascience/utils → graphdatascience-1.15a1/graphdatascience/topological_lp}/__init__.py +0 -0
  144. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +0 -0
  145. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
  146. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/utils/direct_util_endpoints.py +0 -0
  147. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/utils/util_node_property_func_runner.py +0 -0
  148. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/utils/util_proc_runner.py +0 -0
  149. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience/utils/util_remote_proc_runner.py +0 -0
  150. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience.egg-info/dependency_links.txt +0 -0
  151. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience.egg-info/not-zip-safe +0 -0
  152. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience.egg-info/requires.txt +0 -0
  153. {graphdatascience-1.14 → graphdatascience-1.15a1}/graphdatascience.egg-info/top_level.txt +0 -0
  154. {graphdatascience-1.14 → graphdatascience-1.15a1}/pyproject.toml +0 -0
  155. {graphdatascience-1.14 → graphdatascience-1.15a1}/requirements/base/base.txt +0 -0
  156. {graphdatascience-1.14 → graphdatascience-1.15a1}/requirements/base/networkx.txt +0 -0
  157. {graphdatascience-1.14 → graphdatascience-1.15a1}/requirements/base/ogb.txt +0 -0
  158. {graphdatascience-1.14 → graphdatascience-1.15a1}/requirements/base/rust-ext.txt +0 -0
  159. {graphdatascience-1.14 → graphdatascience-1.15a1}/setup.cfg +0 -0
  160. {graphdatascience-1.14 → graphdatascience-1.15a1}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: graphdatascience
3
- Version: 1.14
3
+ Version: 1.15a1
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
@@ -51,6 +51,7 @@ Dynamic: description
51
51
  Dynamic: description-content-type
52
52
  Dynamic: home-page
53
53
  Dynamic: license
54
+ Dynamic: license-file
54
55
  Dynamic: project-url
55
56
  Dynamic: provides-extra
56
57
  Dynamic: requires-dist
@@ -5,6 +5,8 @@ from typing import Any, Optional
5
5
 
6
6
  from pandas import DataFrame
7
7
 
8
+ from graphdatascience.retry_utils.retry_config import RetryConfig
9
+
8
10
  from ..call_parameters import CallParameters
9
11
  from ..query_runner.arrow_info import ArrowInfo
10
12
  from ..server_version.server_version import ServerVersion
@@ -24,6 +26,7 @@ class ArrowQueryRunner(QueryRunner):
24
26
  disable_server_verification: bool = False,
25
27
  tls_root_certs: Optional[bytes] = None,
26
28
  connection_string_override: Optional[str] = None,
29
+ retry_config: Optional[RetryConfig] = None,
27
30
  ) -> ArrowQueryRunner:
28
31
  if not arrow_info.enabled:
29
32
  raise ValueError("Arrow is not enabled on the server")
@@ -35,6 +38,7 @@ class ArrowQueryRunner(QueryRunner):
35
38
  disable_server_verification,
36
39
  tls_root_certs,
37
40
  connection_string_override,
41
+ retry_config=retry_config,
38
42
  )
39
43
 
40
44
  return ArrowQueryRunner(gds_arrow_client, fallback_query_runner, fallback_query_runner.server_version())
@@ -2,6 +2,7 @@ from __future__ import annotations
2
2
 
3
3
  import base64
4
4
  import json
5
+ import logging
5
6
  import re
6
7
  import time
7
8
  import warnings
@@ -12,11 +13,30 @@ from typing import Any, Callable, Dict, Iterable, Optional, Type, Union
12
13
  import pandas
13
14
  import pyarrow
14
15
  from neo4j.exceptions import ClientError
15
- from pyarrow import Array, ChunkedArray, DictionaryArray, RecordBatch, Table, chunked_array, flight
16
+ from pyarrow import Array, ChunkedArray, DictionaryArray, RecordBatch, Schema, Table, chunked_array, flight
16
17
  from pyarrow import __version__ as arrow_version
17
- from pyarrow.flight import ClientMiddleware, ClientMiddlewareFactory
18
+ from pyarrow.flight import (
19
+ ClientMiddleware,
20
+ ClientMiddlewareFactory,
21
+ FlightDescriptor,
22
+ FlightInternalError,
23
+ FlightMetadataReader,
24
+ FlightStreamWriter,
25
+ FlightTimedOutError,
26
+ FlightUnavailableError,
27
+ )
18
28
  from pyarrow.types import is_dictionary
19
- from tenacity import retry, retry_if_exception_type, stop_after_attempt, stop_after_delay, wait_exponential
29
+ from tenacity import (
30
+ retry,
31
+ retry_any,
32
+ retry_if_exception_type,
33
+ stop_after_attempt,
34
+ stop_after_delay,
35
+ wait_exponential,
36
+ )
37
+
38
+ from graphdatascience.retry_utils.retry_config import RetryConfig
39
+ from graphdatascience.retry_utils.retry_utils import before_log
20
40
 
21
41
  from ..semantic_version.semantic_version import SemanticVersion
22
42
  from ..version import __version__
@@ -33,6 +53,7 @@ class GdsArrowClient:
33
53
  disable_server_verification: bool = False,
34
54
  tls_root_certs: Optional[bytes] = None,
35
55
  connection_string_override: Optional[str] = None,
56
+ retry_config: Optional[RetryConfig] = None,
36
57
  ) -> GdsArrowClient:
37
58
  connection_string: str
38
59
  if connection_string_override is not None:
@@ -44,8 +65,20 @@ class GdsArrowClient:
44
65
 
45
66
  arrow_endpoint_version = ArrowEndpointVersion.from_arrow_info(arrow_info.versions)
46
67
 
68
+ if retry_config is None:
69
+ retry_config = RetryConfig(
70
+ retry=retry_any(
71
+ retry_if_exception_type(FlightTimedOutError),
72
+ retry_if_exception_type(FlightUnavailableError),
73
+ retry_if_exception_type(FlightInternalError),
74
+ ),
75
+ stop=(stop_after_delay(10) | stop_after_attempt(5)),
76
+ wait=wait_exponential(multiplier=1, min=1, max=10),
77
+ )
78
+
47
79
  return GdsArrowClient(
48
80
  host,
81
+ retry_config,
49
82
  int(port),
50
83
  auth,
51
84
  encrypted,
@@ -57,6 +90,7 @@ class GdsArrowClient:
57
90
  def __init__(
58
91
  self,
59
92
  host: str,
93
+ retry_config: RetryConfig,
60
94
  port: int = 8491,
61
95
  auth: Optional[tuple[str, str]] = None,
62
96
  encrypted: bool = False,
@@ -85,6 +119,8 @@ class GdsArrowClient:
85
119
  The version of the Arrow endpoint to use (default is ArrowEndpointVersion.V1)
86
120
  user_agent: Optional[str]
87
121
  The user agent string to use for the connection. (default is `neo4j-graphdatascience-v[VERSION] pyarrow-v[PYARROW_VERSION])
122
+ retry_config: Optional[RetryConfig]
123
+ The retry configuration to use for the Arrow requests send by the client.
88
124
  """
89
125
  self._arrow_endpoint_version = arrow_endpoint_version
90
126
  self._host = host
@@ -94,6 +130,8 @@ class GdsArrowClient:
94
130
  self._disable_server_verification = disable_server_verification
95
131
  self._tls_root_certs = tls_root_certs
96
132
  self._user_agent = user_agent
133
+ self._retry_config = retry_config
134
+ self._logger = logging.getLogger("gds_arrow_client")
97
135
 
98
136
  if auth:
99
137
  self._auth_middleware = AuthMiddleware(auth)
@@ -140,9 +178,21 @@ class GdsArrowClient:
140
178
  Optional[str]
141
179
  a token from the server and returns it.
142
180
  """
143
- if self._auth:
181
+
182
+ @retry(
183
+ reraise=True,
184
+ before=before_log("Request token", self._logger, logging.DEBUG),
185
+ retry=self._retry_config.retry,
186
+ stop=self._retry_config.stop,
187
+ wait=self._retry_config.wait,
188
+ )
189
+ def auth_with_retry() -> None:
144
190
  client = self._client()
145
- client.authenticate_basic_token(self._auth[0], self._auth[1])
191
+ if self._auth:
192
+ client.authenticate_basic_token(self._auth[0], self._auth[1])
193
+
194
+ if self._auth:
195
+ auth_with_retry()
146
196
  return self._auth_middleware.token()
147
197
  else:
148
198
  return "IGNORED"
@@ -193,7 +243,7 @@ class GdsArrowClient:
193
243
  if node_labels:
194
244
  config["node_labels"] = node_labels
195
245
 
196
- return self._do_get(database, graph_name, proc, concurrency, config)
246
+ return self._do_get_with_retry(database, graph_name, proc, concurrency, config)
197
247
 
198
248
  def get_node_labels(self, graph_name: str, database: str, concurrency: Optional[int] = None) -> pandas.DataFrame:
199
249
  """
@@ -213,7 +263,7 @@ class GdsArrowClient:
213
263
  DataFrame
214
264
  The requested nodes as a DataFrame
215
265
  """
216
- return self._do_get(database, graph_name, "gds.graph.nodeLabels.stream", concurrency, {})
266
+ return self._do_get_with_retry(database, graph_name, "gds.graph.nodeLabels.stream", concurrency, {})
217
267
 
218
268
  def get_relationships(
219
269
  self, graph_name: str, database: str, relationship_types: list[str], concurrency: Optional[int] = None
@@ -237,7 +287,7 @@ class GdsArrowClient:
237
287
  DataFrame
238
288
  The requested relationships as a DataFrame
239
289
  """
240
- return self._do_get(
290
+ return self._do_get_with_retry(
241
291
  database,
242
292
  graph_name,
243
293
  "gds.graph.relationships.stream",
@@ -285,7 +335,7 @@ class GdsArrowClient:
285
335
  if relationship_types:
286
336
  config["relationship_types"] = relationship_types
287
337
 
288
- return self._do_get(database, graph_name, proc, concurrency, config)
338
+ return self._do_get_with_retry(database, graph_name, proc, concurrency, config)
289
339
 
290
340
  def create_graph(
291
341
  self,
@@ -573,19 +623,29 @@ class GdsArrowClient:
573
623
 
574
624
  def _send_action(self, action_type: str, meta_data: dict[str, Any]) -> dict[str, Any]:
575
625
  action_type = self._versioned_action_type(action_type)
626
+ client = self._client()
576
627
 
577
- try:
578
- client = self._client()
579
- result = client.do_action(flight.Action(action_type, json.dumps(meta_data).encode("utf-8")))
628
+ @retry(
629
+ reraise=True,
630
+ before=before_log("Send action", self._logger, logging.DEBUG),
631
+ retry=self._retry_config.retry,
632
+ stop=self._retry_config.stop,
633
+ wait=self._retry_config.wait,
634
+ )
635
+ def send_with_retry() -> dict[str, Any]:
636
+ try:
637
+ result = client.do_action(flight.Action(action_type, json.dumps(meta_data).encode("utf-8")))
580
638
 
581
- # Consume result fully to sanity check and avoid cancelled streams
582
- collected_result = list(result)
583
- assert len(collected_result) == 1
639
+ # Consume result fully to sanity check and avoid cancelled streams
640
+ collected_result = list(result)
641
+ assert len(collected_result) == 1
584
642
 
585
- return json.loads(collected_result[0].body.to_pybytes().decode()) # type: ignore
586
- except Exception as e:
587
- self.handle_flight_error(e)
588
- raise e # unreachable
643
+ return json.loads(collected_result[0].body.to_pybytes().decode()) # type: ignore
644
+ except Exception as e:
645
+ self.handle_flight_error(e)
646
+ raise e # unreachable
647
+
648
+ return send_with_retry()
589
649
 
590
650
  def _upload_data(
591
651
  self,
@@ -605,17 +665,26 @@ class GdsArrowClient:
605
665
  flight_descriptor = self._versioned_flight_descriptor({"name": graph_name, "entity_type": entity_type})
606
666
  upload_descriptor = flight.FlightDescriptor.for_command(json.dumps(flight_descriptor).encode("utf-8"))
607
667
 
608
- client = self._client()
609
- put_stream, ack_stream = client.do_put(upload_descriptor, batches[0].schema)
668
+ @retry(
669
+ reraise=True,
670
+ before=before_log("Do put", self._logger, logging.DEBUG),
671
+ retry=self._retry_config.retry,
672
+ stop=self._retry_config.stop,
673
+ wait=self._retry_config.wait,
674
+ )
675
+ def safe_do_put(
676
+ upload_descriptor: FlightDescriptor, schema: Schema
677
+ ) -> tuple[FlightStreamWriter, FlightMetadataReader]:
678
+ return self._client().do_put(upload_descriptor, schema) # type: ignore
679
+
680
+ put_stream, ack_stream = safe_do_put(upload_descriptor, batches[0].schema)
610
681
 
611
682
  @retry(
612
- stop=(stop_after_delay(10) | stop_after_attempt(5)),
613
- wait=wait_exponential(multiplier=1, min=1, max=10),
614
- retry=(
615
- retry_if_exception_type(flight.FlightUnavailableError)
616
- | retry_if_exception_type(flight.FlightTimedOutError)
617
- | retry_if_exception_type(flight.FlightInternalError)
618
- ),
683
+ reraise=True,
684
+ before=before_log("Upload batch", self._logger, logging.DEBUG),
685
+ retry=self._retry_config.retry,
686
+ stop=self._retry_config.stop,
687
+ wait=self._retry_config.wait,
619
688
  )
620
689
  def upload_batch(p: RecordBatch) -> None:
621
690
  put_stream.write_batch(p)
@@ -629,6 +698,26 @@ class GdsArrowClient:
629
698
  except Exception as e:
630
699
  GdsArrowClient.handle_flight_error(e)
631
700
 
701
+ def _do_get_with_retry(
702
+ self,
703
+ database: str,
704
+ graph_name: str,
705
+ procedure_name: str,
706
+ concurrency: Optional[int],
707
+ configuration: dict[str, Any],
708
+ ) -> pandas.DataFrame:
709
+ @retry(
710
+ reraise=True,
711
+ before=before_log("Do get", self._logger, logging.DEBUG),
712
+ retry=self._retry_config.retry,
713
+ stop=self._retry_config.stop,
714
+ wait=self._retry_config.wait,
715
+ )
716
+ def safe_do_get() -> pandas.DataFrame:
717
+ return self._do_get(database, graph_name, procedure_name, concurrency, configuration)
718
+
719
+ return safe_do_get()
720
+
632
721
  def _do_get(
633
722
  self,
634
723
  database: str,
@@ -7,9 +7,9 @@ from tenacity import retry, retry_if_result, wait_incrementing
7
7
 
8
8
  from graphdatascience import QueryRunner
9
9
  from graphdatascience.call_parameters import CallParameters
10
- from graphdatascience.query_runner.protocol.retry_utils import before_log
11
10
  from graphdatascience.query_runner.protocol.status import Status
12
11
  from graphdatascience.query_runner.termination_flag import TerminationFlag
12
+ from graphdatascience.retry_utils.retry_utils import before_log
13
13
  from graphdatascience.session.dbms.protocol_version import ProtocolVersion
14
14
 
15
15
 
@@ -133,6 +133,7 @@ class ProjectProtocolV3(ProjectProtocol):
133
133
  logger = getLogger()
134
134
 
135
135
  @retry(
136
+ reraise=True,
136
137
  before=before_log(f"Projection (graph: `{params['graph_name']}`)", logger, DEBUG),
137
138
  retry=retry_if_result(is_not_done),
138
139
  wait=wait_incrementing(start=0.2, increment=0.2, max=2),
@@ -7,9 +7,9 @@ from tenacity import retry, retry_if_result, wait_incrementing
7
7
 
8
8
  from graphdatascience import QueryRunner
9
9
  from graphdatascience.call_parameters import CallParameters
10
- from graphdatascience.query_runner.protocol.retry_utils import before_log
11
10
  from graphdatascience.query_runner.protocol.status import Status
12
11
  from graphdatascience.query_runner.termination_flag import TerminationFlag
12
+ from graphdatascience.retry_utils.retry_utils import before_log
13
13
  from graphdatascience.session.dbms.protocol_version import ProtocolVersion
14
14
 
15
15
 
@@ -142,6 +142,7 @@ class RemoteWriteBackV3(WriteProtocol):
142
142
  logger = logging.getLogger()
143
143
 
144
144
  @retry(
145
+ reraise=True,
145
146
  retry=retry_if_result(is_not_completed),
146
147
  wait=wait_incrementing(start=0.2, increment=0.2, max=2),
147
148
  before=before_log(
@@ -18,8 +18,7 @@ class TerminationFlag(ABC):
18
18
  pass
19
19
 
20
20
  def assert_running(self) -> None:
21
- if self.is_set():
22
- raise RuntimeError("Query has been terminated")
21
+ pass
23
22
 
24
23
  @staticmethod
25
24
  def create(signals: Optional[list[signal.Signals]] = None) -> TerminationFlag:
@@ -38,7 +37,7 @@ class TerminationFlagImpl(TerminationFlag):
38
37
  self._event = threading.Event()
39
38
 
40
39
  def receive_signal(sig: int, frame: Optional[FrameType]) -> None:
41
- logging.debug(f"Received signal {sig}. Interrupting query.")
40
+ logging.info(f"Received signal {sig}.")
42
41
  self._event.set()
43
42
 
44
43
  for sig in signals:
@@ -52,7 +51,7 @@ class TerminationFlagImpl(TerminationFlag):
52
51
 
53
52
  def assert_running(self) -> None:
54
53
  if self.is_set():
55
- raise RuntimeError("Query has been terminated")
54
+ raise RuntimeError("Closing client connection. Note, the query will be continued on the server-side")
56
55
 
57
56
 
58
57
  class TerminationFlagNoop(TerminationFlag):
@@ -0,0 +1,12 @@
1
+ from dataclasses import dataclass
2
+
3
+ from tenacity.retry import retry_base
4
+ from tenacity.stop import stop_base
5
+ from tenacity.wait import wait_base
6
+
7
+
8
+ @dataclass(frozen=True, repr=True)
9
+ class RetryConfig:
10
+ stop: stop_base
11
+ wait: wait_base
12
+ retry: retry_base
@@ -11,9 +11,10 @@ def before_log(
11
11
  sec_format: str = "%0.3f",
12
12
  ) -> typing.Callable[[RetryCallState], None]:
13
13
  def log_it(retry_state: RetryCallState) -> None:
14
- logger.log(
15
- log_level,
16
- f"Retry of '{fn_name}', " f"attempt: {retry_state.attempt_number}",
17
- )
14
+ if retry_state.attempt_number > 1: # only log on actual retry
15
+ logger.log(
16
+ log_level,
17
+ f"Retry of '{fn_name}', " f"attempt: {retry_state.attempt_number}",
18
+ )
18
19
 
19
20
  return log_it
@@ -3,6 +3,7 @@ from __future__ import annotations
3
3
  import logging
4
4
  import math
5
5
  import time
6
+ import uuid
6
7
  import warnings
7
8
  from collections import defaultdict
8
9
  from datetime import timedelta
@@ -44,8 +45,9 @@ class AuraApi:
44
45
  self, client_id: str, client_secret: str, tenant_id: Optional[str] = None, aura_env: Optional[str] = None
45
46
  ) -> None:
46
47
  self._base_uri = AuraApi.base_uri(aura_env)
48
+ self._credentials = (client_id, client_secret)
47
49
 
48
- self._request_session = self._init_request_session((client_id, client_secret))
50
+ self._request_session = self._init_request_session(self._credentials)
49
51
  self._logger = logging.getLogger()
50
52
 
51
53
  self._tenant_id = tenant_id if tenant_id else self._get_tenant_id()
@@ -99,12 +101,12 @@ class AuraApi:
99
101
  def get_or_create_session(
100
102
  self,
101
103
  name: str,
102
- pwd: str,
103
104
  memory: SessionMemoryValue,
104
105
  dbid: Optional[str] = None,
105
106
  ttl: Optional[timedelta] = None,
106
107
  cloud_location: Optional[CloudLocation] = None,
107
108
  ) -> SessionDetails:
109
+ pwd = str(uuid.uuid4()) # password wont be used and will go away in v1 endpoints
108
110
  json = {"name": name, "password": pwd, "memory": memory.value, "tenant_id": self._tenant_id}
109
111
 
110
112
  if dbid:
@@ -164,7 +166,7 @@ class AuraApi:
164
166
  def wait_for_session_running(
165
167
  self,
166
168
  session_id: str,
167
- sleep_time: float = 0.2,
169
+ sleep_time: float = 1.0,
168
170
  max_sleep_time: float = 10,
169
171
  max_wait_time: float = math.inf,
170
172
  ) -> WaitResult:
@@ -173,10 +175,16 @@ class AuraApi:
173
175
  session = self.get_session(session_id)
174
176
  if session is None:
175
177
  return WaitResult.from_error(f"Session `{session_id}` not found -- please retry")
176
- elif session.status == "Ready" and session.host: # check host needed until dns based routing
178
+ elif session.status == "Ready":
177
179
  return WaitResult.from_connection_url(session.bolt_connection_url())
178
180
  elif session.status == "Failed":
179
- return WaitResult.from_error(f"Session `{session_id}` failed due to: {session.errors}")
181
+ return WaitResult.from_error(
182
+ f"Session `{session_id}` with name `{session.name}` failed due to: {session.errors}"
183
+ )
184
+ elif session.is_expired():
185
+ return WaitResult.from_error(
186
+ f"Session `{session_id}` with name `{session.name}` is expired. Expired due to: {session.errors}"
187
+ )
180
188
  else:
181
189
  self._logger.debug(
182
190
  f"Session `{session_id}` is not yet running. "
@@ -1,6 +1,5 @@
1
1
  from __future__ import annotations
2
2
 
3
- import hashlib
4
3
  import math
5
4
  import warnings
6
5
  from datetime import datetime, timedelta, timezone
@@ -74,10 +73,7 @@ class DedicatedSessions:
74
73
 
75
74
  dbid = AuraApi.extract_id(db_connection.uri)
76
75
 
77
- # hashing the password to avoid storing the actual db password in Aura
78
- password = hashlib.sha256(db_connection.password.encode()).hexdigest()
79
-
80
- session_details = self._get_or_create_session(session_name, dbid, password, memory.value, ttl, cloud_location)
76
+ session_details = self._get_or_create_session(session_name, dbid, memory.value, ttl, cloud_location)
81
77
 
82
78
  if session_details.expiry_date:
83
79
  until_expiry: timedelta = session_details.expiry_date - datetime.now(timezone.utc)
@@ -95,8 +91,8 @@ class DedicatedSessions:
95
91
 
96
92
  session_connection = DbmsConnectionInfo(
97
93
  uri=connection_url,
98
- username=DedicatedSessions.GDS_SESSION_USER,
99
- password=password,
94
+ username=self._aura_api._credentials[0],
95
+ password=self._aura_api._credentials[1],
100
96
  )
101
97
 
102
98
  return self._construct_client(
@@ -154,7 +150,6 @@ class DedicatedSessions:
154
150
  self,
155
151
  session_name: str,
156
152
  dbid: str,
157
- pwd: str,
158
153
  memory: SessionMemoryValue,
159
154
  ttl: Optional[timedelta] = None,
160
155
  cloud_location: Optional[CloudLocation] = None,
@@ -171,13 +166,12 @@ class DedicatedSessions:
171
166
  if cloud_location:
172
167
  return self._aura_api.get_or_create_session(
173
168
  name=session_name,
174
- pwd=pwd,
175
169
  memory=memory,
176
170
  ttl=ttl,
177
171
  cloud_location=cloud_location,
178
172
  )
179
173
  else:
180
- return self._aura_api.get_or_create_session(name=session_name, dbid=dbid, pwd=pwd, memory=memory, ttl=ttl)
174
+ return self._aura_api.get_or_create_session(name=session_name, dbid=dbid, memory=memory, ttl=ttl)
181
175
 
182
176
  def _construct_client(
183
177
  self,
@@ -1,2 +1,2 @@
1
- __version__ = "1.14"
1
+ __version__ = "1.15a1"
2
2
  __min_server_version__ = "2.6.0" # matches installation.adoc
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.2
1
+ Metadata-Version: 2.4
2
2
  Name: graphdatascience
3
- Version: 1.14
3
+ Version: 1.15a1
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
@@ -51,6 +51,7 @@ Dynamic: description
51
51
  Dynamic: description-content-type
52
52
  Dynamic: home-page
53
53
  Dynamic: license
54
+ Dynamic: license-file
54
55
  Dynamic: project-url
55
56
  Dynamic: provides-extra
56
57
  Dynamic: requires-dist
@@ -93,7 +93,6 @@ graphdatascience/query_runner/progress/query_progress_provider.py
93
93
  graphdatascience/query_runner/progress/static_progress_provider.py
94
94
  graphdatascience/query_runner/protocol/__init__.py
95
95
  graphdatascience/query_runner/protocol/project_protocols.py
96
- graphdatascience/query_runner/protocol/retry_utils.py
97
96
  graphdatascience/query_runner/protocol/status.py
98
97
  graphdatascience/query_runner/protocol/write_protocols.py
99
98
  graphdatascience/resources/__init__.py
@@ -118,6 +117,9 @@ graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip
118
117
  graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip
119
118
  graphdatascience/resources/lastfm/user_nodes.parquet.gzip
120
119
  graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip
120
+ graphdatascience/retry_utils/__init__.py
121
+ graphdatascience/retry_utils/retry_config.py
122
+ graphdatascience/retry_utils/retry_utils.py
121
123
  graphdatascience/semantic_version/__init__.py
122
124
  graphdatascience/semantic_version/semantic_version.py
123
125
  graphdatascience/server_version/__init__.py