graphdatascience 1.15.1__tar.gz → 1.17__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.15.1/graphdatascience.egg-info → graphdatascience-1.17}/PKG-INFO +3 -2
- graphdatascience-1.17/graphdatascience/arrow_client/arrow_base_model.py +12 -0
- graphdatascience-1.17/graphdatascience/arrow_client/authenticated_flight_client.py +219 -0
- graphdatascience-1.17/graphdatascience/arrow_client/middleware/auth_middleware.py +63 -0
- graphdatascience-1.17/graphdatascience/arrow_client/middleware/user_agent_middleware.py +26 -0
- graphdatascience-1.17/graphdatascience/arrow_client/v2/api_types.py +17 -0
- graphdatascience-1.17/graphdatascience/arrow_client/v2/data_mapper_utils.py +19 -0
- graphdatascience-1.17/graphdatascience/arrow_client/v2/job_client.py +58 -0
- graphdatascience-1.17/graphdatascience/arrow_client/v2/mutation_client.py +18 -0
- graphdatascience-1.17/graphdatascience/arrow_client/v2/remote_write_back_client.py +79 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/cypher_warning_handler.py +4 -7
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_cypher_runner.py +6 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_entity_ops_runner.py +13 -6
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_object.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph_data_science.py +83 -11
- graphdatascience-1.17/graphdatascience/model/v2/model.py +59 -0
- graphdatascience-1.17/graphdatascience/model/v2/model_api.py +51 -0
- graphdatascience-1.17/graphdatascience/model/v2/model_details.py +20 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/articlerank_endpoints.py +338 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/articulationpoints_endpoints.py +243 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/base_result.py +9 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/betweenness_endpoints.py +293 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/graph_api.py +174 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/graph_backend.py +20 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/graph_info.py +38 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py +113 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py +176 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog/relationships_endpoints.py +259 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog_endpoints.py +225 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/celf_endpoints.py +318 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/closeness_endpoints.py +277 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/closeness_harmonic_endpoints.py +261 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/degree_endpoints.py +311 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/eigenvector_endpoints.py +343 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/estimation_result.py +21 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/fastrp_endpoints.py +359 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/graph_sampling_endpoints.py +181 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/graphsage_predict_endpoints.py +230 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/graphsage_train_endpoints.py +118 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/hashgnn_endpoints.py +271 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/k1coloring_endpoints.py +287 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/kcore_endpoints.py +253 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/louvain_endpoints.py +370 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/model/graphsage_model.py +267 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/node2vec_endpoints.py +386 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/pagerank_endpoints.py +343 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/scc_endpoints.py +265 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/api/wcc_endpoints.py +316 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/articlerank_arrow_endpoints.py +204 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/articulationpoints_arrow_endpoints.py +143 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/betweenness_arrow_endpoints.py +180 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog/graph_backend_arrow.py +33 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog/graph_ops_arrow.py +28 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog/node_label_arrow_endpoints.py +78 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog/node_properties_arrow_endpoints.py +143 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog/relationship_arrow_endpoints.py +188 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog_arrow_endpoints.py +260 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/celf_arrow_endpoints.py +176 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/closeness_arrow_endpoints.py +157 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/closeness_harmonic_arrow_endpoints.py +145 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/degree_arrow_endpoints.py +155 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/eigenvector_arrow_endpoints.py +199 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/fastrp_arrow_endpoints.py +220 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/graph_sampling_arrow_endpoints.py +101 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/graphsage_predict_arrow_endpoints.py +156 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/graphsage_train_arrow_endpoints.py +90 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/hashgnn_arrow_endpoints.py +206 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/k1coloring_arrow_endpoints.py +168 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/kcore_arrow_endpoints.py +138 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/louvain_arrow_endpoints.py +210 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/model_api_arrow.py +57 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/node2vec_arrow_endpoints.py +244 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/node_property_endpoints.py +117 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/pagerank_arrow_endpoints.py +194 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/scc_arrow_endpoints.py +145 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/arrow/wcc_arrow_endpoints.py +179 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/articlerank_cypher_endpoints.py +223 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/articulationpoints_cypher_endpoints.py +170 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/betweenness_cypher_endpoints.py +192 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog/graph_backend_cypher.py +57 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog/node_label_cypher_endpoints.py +78 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog/node_properties_cypher_endpoints.py +130 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog/relationship_cypher_endpoints.py +227 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog_cypher_endpoints.py +197 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/celf_cypher_endpoints.py +203 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/closeness_cypher_endpoints.py +175 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/closeness_harmonic_cypher_endpoints.py +169 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/degree_cypher_endpoints.py +180 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/eigenvector_cypher_endpoints.py +216 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/estimation_utils.py +60 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/fastrp_cypher_endpoints.py +245 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/graph_sampling_cypher_endpoints.py +106 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/graphsage_predict_cypher_endpoints.py +155 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/graphsage_train_cypher_endpoints.py +90 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/hashgnn_cypher_endpoints.py +219 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/k1coloring_cypher_endpoints.py +183 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/kcore_cypher_endpoints.py +158 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/louvain_cypher_endpoints.py +228 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/model_api_cypher.py +49 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/node2vec_cypher_endpoints.py +252 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/pagerank_cypher_endpoints.py +219 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/scc_cypher_endpoints.py +164 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/cypher/wcc_cypher_endpoints.py +198 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/utils/config_converter.py +38 -0
- graphdatascience-1.17/graphdatascience/procedure_surface/utils/result_utils.py +41 -0
- graphdatascience-1.17/graphdatascience/query_runner/arrow_authentication/__init__.py +3 -0
- graphdatascience-1.17/graphdatascience/query_runner/arrow_info/__init__.py +5 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/arrow_query_runner.py +28 -12
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/cypher_graph_constructor.py +9 -5
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/gds_arrow_client.py +58 -33
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/neo4j_query_runner.py +105 -27
- graphdatascience-1.17/graphdatascience/query_runner/protocol/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/protocol/project_protocols.py +21 -5
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/protocol/write_protocols.py +16 -10
- graphdatascience-1.17/graphdatascience/query_runner/query_mode.py +24 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/query_runner.py +17 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/session_query_runner.py +25 -6
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/standalone_session_query_runner.py +18 -2
- graphdatascience-1.17/graphdatascience/resources/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/resources/cora/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/resources/imdb/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/resources/karate/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/resources/lastfm/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/retry_utils/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/retry_utils/retry_utils.py +1 -1
- graphdatascience-1.17/graphdatascience/semantic_version/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/server_version/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/aura_api.py +11 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/aura_graph_data_science.py +33 -9
- graphdatascience-1.17/graphdatascience/session/aurads_sessions.py +0 -0
- graphdatascience-1.17/graphdatascience/session/dbms/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/dbms/protocol_resolver.py +4 -2
- graphdatascience-1.17/graphdatascience/session/dbms_connection_info.py +57 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/dedicated_sessions.py +12 -4
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/gds_sessions.py +28 -3
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/session_info.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/session_sizes.py +1 -0
- graphdatascience-1.17/graphdatascience/session/session_v2_endpoints.py +115 -0
- graphdatascience-1.17/graphdatascience/system/__init__.py +0 -0
- graphdatascience-1.17/graphdatascience/topological_lp/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +2 -2
- graphdatascience-1.17/graphdatascience/utils/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/utils/direct_util_endpoints.py +4 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/utils/util_proc_runner.py +2 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/utils/util_remote_proc_runner.py +4 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/version.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17/graphdatascience.egg-info}/PKG-INFO +3 -2
- graphdatascience-1.17/graphdatascience.egg-info/SOURCES.txt +278 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience.egg-info/requires.txt +2 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17}/requirements/base/base.txt +2 -1
- graphdatascience-1.15.1/graphdatascience/session/dbms_connection_info.py +0 -25
- graphdatascience-1.15.1/graphdatascience.egg-info/SOURCES.txt +0 -161
- {graphdatascience-1.15.1 → graphdatascience-1.17}/LICENSE +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/MANIFEST.in +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/README.md +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/algo/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/algo/algo_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/algo/algo_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/error → graphdatascience-1.17/graphdatascience/arrow_client}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner → graphdatascience-1.17/graphdatascience/arrow_client}/arrow_authentication.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner → graphdatascience-1.17/graphdatascience/arrow_client}/arrow_info.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/graph → graphdatascience-1.17/graphdatascience/arrow_client/middleware}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/model → graphdatascience-1.17/graphdatascience/arrow_client/v2}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/call_builder.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/call_parameters.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/caller_base.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/endpoints.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/pipeline → graphdatascience-1.17/graphdatascience/error}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/client_only_endpoint.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/endpoint_suggester.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/gds_not_installed.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/illegal_attr_checker.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/unable_to_connect.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/uncallable_namespace.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner → graphdatascience-1.17/graphdatascience/graph}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/base_graph_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_create_result.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_export_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_project_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_remote_project_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_sample_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_type_check.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/nx_loader.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/ogb_loader.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/ignored_server_endpoints.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner/progress → graphdatascience-1.17/graphdatascience/model}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/graphsage_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/link_prediction_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/model_resolver.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/node_classification_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/node_regression_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/pipeline_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/model/simple_rel_embedding_model.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner/protocol → graphdatascience-1.17/graphdatascience/model/v2}/__init__.py +0 -0
- /graphdatascience-1.15.1/graphdatascience/py.typed → /graphdatascience-1.17/graphdatascience/model/v2/graphsage_model.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources → graphdatascience-1.17/graphdatascience/pipeline}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/nc_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/nr_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/pipeline/training_pipeline.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/cora → graphdatascience-1.17/graphdatascience/procedure_surface}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/imdb → graphdatascience-1.17/graphdatascience/procedure_surface/api}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/karate → graphdatascience-1.17/graphdatascience/procedure_surface/api/catalog}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/lastfm → graphdatascience-1.17/graphdatascience/procedure_surface/api/model}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/retry_utils → graphdatascience-1.17/graphdatascience/procedure_surface/arrow}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/semantic_version → graphdatascience-1.17/graphdatascience/procedure_surface/arrow/catalog}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/server_version → graphdatascience-1.17/graphdatascience/procedure_surface/cypher}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/session/dbms → graphdatascience-1.17/graphdatascience/procedure_surface/cypher/catalog}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/system → graphdatascience-1.17/graphdatascience/procedure_surface/utils}/__init__.py +0 -0
- /graphdatascience-1.15.1/graphdatascience/session/aurads_sessions.py → /graphdatascience-1.17/graphdatascience/py.typed +0 -0
- {graphdatascience-1.15.1/graphdatascience/topological_lp → graphdatascience-1.17/graphdatascience/query_runner}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/arrow_endpoint_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/arrow_graph_constructor.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/graph_constructor.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/utils → graphdatascience-1.17/graphdatascience/query_runner/progress}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/progress/progress_provider.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/progress/query_progress_logger.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/progress/query_progress_provider.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/progress/static_progress_provider.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/protocol/status.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/query_runner/termination_flag.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/cora/serialize_cora.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/retry_utils/retry_config.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/semantic_version/semantic_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/server_version/compatible_with.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/server_version/server_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/algorithm_category.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/aura_api_responses.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/aura_api_token_authentication.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/cloud_location.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/dbms/protocol_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/session/region_suggester.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/system/config_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/system/system_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/utils/util_node_property_func_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience.egg-info/dependency_links.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience.egg-info/not-zip-safe +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience.egg-info/top_level.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/pyproject.toml +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/requirements/base/networkx.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/requirements/base/ogb.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/requirements/base/rust-ext.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/setup.cfg +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphdatascience
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17
|
|
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
|
|
@@ -32,12 +32,13 @@ Requires-Dist: multimethod<3.0,>=1.0
|
|
|
32
32
|
Requires-Dist: neo4j<6.0,>=4.4.12
|
|
33
33
|
Requires-Dist: numpy<2.3
|
|
34
34
|
Requires-Dist: pandas<3.0,>=1.0
|
|
35
|
-
Requires-Dist: pyarrow<
|
|
35
|
+
Requires-Dist: pyarrow<21.0,>=17.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
40
|
Requires-Dist: tenacity>=9.0
|
|
41
|
+
Requires-Dist: pydantic>=2.11
|
|
41
42
|
Provides-Extra: ogb
|
|
42
43
|
Requires-Dist: ogb<2.0,>=1.0; extra == "ogb"
|
|
43
44
|
Provides-Extra: networkx
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
|
|
3
|
+
from pydantic import BaseModel
|
|
4
|
+
from pydantic.alias_generators import to_camel
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class ArrowBaseModel(BaseModel, alias_generator=to_camel):
|
|
8
|
+
def dump_camel(self) -> dict[str, Any]:
|
|
9
|
+
return self.model_dump(by_alias=True)
|
|
10
|
+
|
|
11
|
+
def dump_json(self) -> str:
|
|
12
|
+
return self.model_dump_json(by_alias=True)
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import json
|
|
4
|
+
import logging
|
|
5
|
+
from dataclasses import dataclass
|
|
6
|
+
from typing import Any, Iterator, Optional, Tuple, Union
|
|
7
|
+
|
|
8
|
+
from pyarrow import __version__ as arrow_version
|
|
9
|
+
from pyarrow import flight
|
|
10
|
+
from pyarrow._flight import (
|
|
11
|
+
Action,
|
|
12
|
+
FlightInternalError,
|
|
13
|
+
FlightStreamReader,
|
|
14
|
+
FlightTimedOutError,
|
|
15
|
+
FlightUnavailableError,
|
|
16
|
+
Result,
|
|
17
|
+
Ticket,
|
|
18
|
+
)
|
|
19
|
+
from tenacity import retry, retry_any, retry_if_exception_type, stop_after_attempt, stop_after_delay, wait_exponential
|
|
20
|
+
|
|
21
|
+
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
|
|
22
|
+
from graphdatascience.arrow_client.arrow_info import ArrowInfo
|
|
23
|
+
from graphdatascience.retry_utils.retry_config import RetryConfig
|
|
24
|
+
|
|
25
|
+
from ..retry_utils.retry_utils import before_log
|
|
26
|
+
from ..version import __version__
|
|
27
|
+
from .middleware.auth_middleware import AuthFactory, AuthMiddleware
|
|
28
|
+
from .middleware.user_agent_middleware import UserAgentFactory
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class AuthenticatedArrowClient:
|
|
32
|
+
@staticmethod
|
|
33
|
+
def create(
|
|
34
|
+
arrow_info: ArrowInfo,
|
|
35
|
+
auth: Optional[ArrowAuthentication] = None,
|
|
36
|
+
encrypted: bool = False,
|
|
37
|
+
arrow_client_options: Optional[dict[str, Any]] = None,
|
|
38
|
+
connection_string_override: Optional[str] = None,
|
|
39
|
+
retry_config: Optional[RetryConfig] = None,
|
|
40
|
+
advertised_listen_address: Optional[Tuple[str, int]] = None,
|
|
41
|
+
) -> AuthenticatedArrowClient:
|
|
42
|
+
connection_string: str
|
|
43
|
+
if connection_string_override is not None:
|
|
44
|
+
connection_string = connection_string_override
|
|
45
|
+
else:
|
|
46
|
+
connection_string = arrow_info.listenAddress
|
|
47
|
+
|
|
48
|
+
host, port = connection_string.split(":")
|
|
49
|
+
|
|
50
|
+
if retry_config is None:
|
|
51
|
+
retry_config = RetryConfig(
|
|
52
|
+
retry=retry_any(
|
|
53
|
+
retry_if_exception_type(FlightTimedOutError),
|
|
54
|
+
retry_if_exception_type(FlightUnavailableError),
|
|
55
|
+
retry_if_exception_type(FlightInternalError),
|
|
56
|
+
),
|
|
57
|
+
stop=(stop_after_delay(10) | stop_after_attempt(5)),
|
|
58
|
+
wait=wait_exponential(multiplier=1, min=1, max=10),
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
return AuthenticatedArrowClient(
|
|
62
|
+
host=host,
|
|
63
|
+
retry_config=retry_config,
|
|
64
|
+
port=int(port),
|
|
65
|
+
auth=auth,
|
|
66
|
+
encrypted=encrypted,
|
|
67
|
+
arrow_client_options=arrow_client_options,
|
|
68
|
+
advertised_listen_address=advertised_listen_address,
|
|
69
|
+
)
|
|
70
|
+
|
|
71
|
+
def __init__(
|
|
72
|
+
self,
|
|
73
|
+
host: str,
|
|
74
|
+
retry_config: RetryConfig,
|
|
75
|
+
port: int = 8491,
|
|
76
|
+
auth: Optional[ArrowAuthentication] = None,
|
|
77
|
+
encrypted: bool = False,
|
|
78
|
+
arrow_client_options: Optional[dict[str, Any]] = None,
|
|
79
|
+
user_agent: Optional[str] = None,
|
|
80
|
+
advertised_listen_address: Optional[Tuple[str, int]] = None,
|
|
81
|
+
):
|
|
82
|
+
"""Creates a new GdsArrowClient instance.
|
|
83
|
+
|
|
84
|
+
Parameters
|
|
85
|
+
----------
|
|
86
|
+
host: str
|
|
87
|
+
The host address of the GDS Arrow server
|
|
88
|
+
port: int
|
|
89
|
+
The host port of the GDS Arrow server (default is 8491)
|
|
90
|
+
auth: Optional[ArrowAuthentication]
|
|
91
|
+
An implementation of ArrowAuthentication providing a pair to be used for basic authentication
|
|
92
|
+
encrypted: bool
|
|
93
|
+
A flag that indicates whether the connection should be encrypted (default is False)
|
|
94
|
+
arrow_client_options: Optional[dict[str, Any]]
|
|
95
|
+
Additional options to be passed to the Arrow Flight client.
|
|
96
|
+
user_agent: Optional[str]
|
|
97
|
+
The user agent string to use for the connection. (default is `neo4j-graphdatascience-v[VERSION] pyarrow-v[PYARROW_VERSION])
|
|
98
|
+
retry_config: Optional[RetryConfig]
|
|
99
|
+
The retry configuration to use for the Arrow requests send by the client.
|
|
100
|
+
advertised_listen_address: Optional[Tuple[str, int]]
|
|
101
|
+
The advertised listen address of the GDS Arrow server. This will be used by remote projection and writeback operations.
|
|
102
|
+
"""
|
|
103
|
+
self._host = host
|
|
104
|
+
self._port = port
|
|
105
|
+
self._auth = None
|
|
106
|
+
self._encrypted = encrypted
|
|
107
|
+
self._arrow_client_options = arrow_client_options
|
|
108
|
+
self._user_agent = user_agent
|
|
109
|
+
self._retry_config = retry_config
|
|
110
|
+
self._logger = logging.getLogger("gds_arrow_client")
|
|
111
|
+
self._retry_config = retry_config
|
|
112
|
+
if auth:
|
|
113
|
+
self._auth = auth
|
|
114
|
+
self._auth_middleware = AuthMiddleware(auth)
|
|
115
|
+
self.advertised_listen_address = advertised_listen_address
|
|
116
|
+
|
|
117
|
+
self._flight_client = self._instantiate_flight_client()
|
|
118
|
+
|
|
119
|
+
def connection_info(self) -> ConnectionInfo:
|
|
120
|
+
"""
|
|
121
|
+
Returns the host and port of the GDS Arrow server.
|
|
122
|
+
|
|
123
|
+
Returns
|
|
124
|
+
-------
|
|
125
|
+
tuple[str, int]
|
|
126
|
+
the host and port of the GDS Arrow server
|
|
127
|
+
"""
|
|
128
|
+
return ConnectionInfo(self._host, self._port, self._encrypted)
|
|
129
|
+
|
|
130
|
+
def advertised_connection_info(self) -> ConnectionInfo:
|
|
131
|
+
"""
|
|
132
|
+
Returns the advertised host and port of the GDS Arrow server.
|
|
133
|
+
|
|
134
|
+
Returns
|
|
135
|
+
-------
|
|
136
|
+
ConnectionInfo
|
|
137
|
+
the host and port of the GDS Arrow server
|
|
138
|
+
"""
|
|
139
|
+
if self.advertised_listen_address is None:
|
|
140
|
+
return self.connection_info()
|
|
141
|
+
|
|
142
|
+
h, p = self.advertised_listen_address
|
|
143
|
+
return ConnectionInfo(h, p, self._encrypted)
|
|
144
|
+
|
|
145
|
+
def request_token(self) -> Optional[str]:
|
|
146
|
+
"""
|
|
147
|
+
Requests a token from the server and returns it.
|
|
148
|
+
|
|
149
|
+
Returns
|
|
150
|
+
-------
|
|
151
|
+
Optional[str]
|
|
152
|
+
a token from the server and returns it.
|
|
153
|
+
"""
|
|
154
|
+
|
|
155
|
+
@retry(
|
|
156
|
+
reraise=True,
|
|
157
|
+
before=before_log("Request token", self._logger, logging.DEBUG),
|
|
158
|
+
retry=self._retry_config.retry,
|
|
159
|
+
stop=self._retry_config.stop,
|
|
160
|
+
wait=self._retry_config.wait,
|
|
161
|
+
)
|
|
162
|
+
def auth_with_retry() -> None:
|
|
163
|
+
client = self._flight_client
|
|
164
|
+
if self._auth:
|
|
165
|
+
auth_pair = self._auth.auth_pair()
|
|
166
|
+
client.authenticate_basic_token(auth_pair[0], auth_pair[1])
|
|
167
|
+
|
|
168
|
+
if self._auth:
|
|
169
|
+
auth_with_retry()
|
|
170
|
+
return self._auth_middleware.token()
|
|
171
|
+
else:
|
|
172
|
+
return "IGNORED"
|
|
173
|
+
|
|
174
|
+
def get_stream(self, ticket: Ticket) -> FlightStreamReader:
|
|
175
|
+
return self._flight_client.do_get(ticket)
|
|
176
|
+
|
|
177
|
+
def do_action(self, endpoint: str, payload: Union[bytes, dict[str, Any]]) -> Iterator[Result]:
|
|
178
|
+
payload_bytes = payload if isinstance(payload, bytes) else json.dumps(payload).encode("utf-8")
|
|
179
|
+
|
|
180
|
+
return self._flight_client.do_action(Action(endpoint, payload_bytes)) # type: ignore
|
|
181
|
+
|
|
182
|
+
def do_action_with_retry(self, endpoint: str, payload: Union[bytes, dict[str, Any]]) -> Iterator[Result]:
|
|
183
|
+
@retry(
|
|
184
|
+
reraise=True,
|
|
185
|
+
before=before_log("Send action", self._logger, logging.DEBUG),
|
|
186
|
+
retry=self._retry_config.retry,
|
|
187
|
+
stop=self._retry_config.stop,
|
|
188
|
+
wait=self._retry_config.wait,
|
|
189
|
+
)
|
|
190
|
+
def run_with_retry() -> Iterator[Result]:
|
|
191
|
+
return self.do_action(endpoint, payload)
|
|
192
|
+
|
|
193
|
+
return run_with_retry()
|
|
194
|
+
|
|
195
|
+
def _instantiate_flight_client(self) -> flight.FlightClient:
|
|
196
|
+
location = (
|
|
197
|
+
flight.Location.for_grpc_tls(self._host, self._port)
|
|
198
|
+
if self._encrypted
|
|
199
|
+
else flight.Location.for_grpc_tcp(self._host, self._port)
|
|
200
|
+
)
|
|
201
|
+
client_options: dict[str, Any] = (self._arrow_client_options or {}).copy()
|
|
202
|
+
if self._auth:
|
|
203
|
+
user_agent = f"neo4j-graphdatascience-v{__version__} pyarrow-v{arrow_version}"
|
|
204
|
+
if self._user_agent:
|
|
205
|
+
user_agent = self._user_agent
|
|
206
|
+
|
|
207
|
+
client_options["middleware"] = [
|
|
208
|
+
AuthFactory(self._auth_middleware),
|
|
209
|
+
UserAgentFactory(useragent=user_agent),
|
|
210
|
+
]
|
|
211
|
+
|
|
212
|
+
return flight.FlightClient(location, **client_options)
|
|
213
|
+
|
|
214
|
+
|
|
215
|
+
@dataclass
|
|
216
|
+
class ConnectionInfo:
|
|
217
|
+
host: str
|
|
218
|
+
port: int
|
|
219
|
+
encrypted: bool
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import base64
|
|
4
|
+
import time
|
|
5
|
+
from typing import Any, Optional
|
|
6
|
+
|
|
7
|
+
from pyarrow._flight import ClientMiddleware, ClientMiddlewareFactory
|
|
8
|
+
|
|
9
|
+
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
class AuthFactory(ClientMiddlewareFactory): # type: ignore
|
|
13
|
+
def __init__(self, middleware: AuthMiddleware, *args: Any, **kwargs: Any) -> None:
|
|
14
|
+
super().__init__(*args, **kwargs)
|
|
15
|
+
self._middleware = middleware
|
|
16
|
+
|
|
17
|
+
def start_call(self, info: Any) -> AuthMiddleware:
|
|
18
|
+
return self._middleware
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
class AuthMiddleware(ClientMiddleware): # type: ignore
|
|
22
|
+
def __init__(self, auth: ArrowAuthentication, *args: Any, **kwargs: Any) -> None:
|
|
23
|
+
super().__init__(*args, **kwargs)
|
|
24
|
+
self._auth = auth
|
|
25
|
+
self._token: Optional[str] = None
|
|
26
|
+
self._token_timestamp = 0
|
|
27
|
+
|
|
28
|
+
def token(self) -> Optional[str]:
|
|
29
|
+
# check whether the token is older than 10 minutes. If so, reset it.
|
|
30
|
+
if self._token and int(time.time()) - self._token_timestamp > 600:
|
|
31
|
+
self._token = None
|
|
32
|
+
|
|
33
|
+
return self._token
|
|
34
|
+
|
|
35
|
+
def _set_token(self, token: str) -> None:
|
|
36
|
+
self._token = token
|
|
37
|
+
self._token_timestamp = int(time.time())
|
|
38
|
+
|
|
39
|
+
def received_headers(self, headers: dict[str, Any]) -> None:
|
|
40
|
+
auth_header = headers.get("authorization", None)
|
|
41
|
+
if not auth_header:
|
|
42
|
+
return
|
|
43
|
+
|
|
44
|
+
# the result is always a list
|
|
45
|
+
header_value = auth_header[0]
|
|
46
|
+
|
|
47
|
+
if not isinstance(header_value, str):
|
|
48
|
+
raise ValueError(f"Incompatible header value received from server: `{header_value}`")
|
|
49
|
+
|
|
50
|
+
auth_type, token = header_value.split(" ", 1)
|
|
51
|
+
if auth_type == "Bearer":
|
|
52
|
+
self._set_token(token)
|
|
53
|
+
|
|
54
|
+
def sending_headers(self) -> dict[str, str]:
|
|
55
|
+
token = self.token()
|
|
56
|
+
if token is not None:
|
|
57
|
+
return {"authorization": "Bearer " + token}
|
|
58
|
+
|
|
59
|
+
auth_pair = self._auth.auth_pair()
|
|
60
|
+
auth_token = f"{auth_pair[0]}:{auth_pair[1]}"
|
|
61
|
+
auth_token = "Basic " + base64.b64encode(auth_token.encode("utf-8")).decode("ASCII")
|
|
62
|
+
# There seems to be a bug, `authorization` must be lower key
|
|
63
|
+
return {"authorization": auth_token}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
from typing import Any
|
|
4
|
+
|
|
5
|
+
from pyarrow._flight import ClientMiddleware, ClientMiddlewareFactory
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class UserAgentFactory(ClientMiddlewareFactory): # type: ignore
|
|
9
|
+
def __init__(self, useragent: str, *args: Any, **kwargs: Any) -> None:
|
|
10
|
+
super().__init__(*args, **kwargs)
|
|
11
|
+
self._middleware = UserAgentMiddleware(useragent)
|
|
12
|
+
|
|
13
|
+
def start_call(self, info: Any) -> ClientMiddleware:
|
|
14
|
+
return self._middleware
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class UserAgentMiddleware(ClientMiddleware): # type: ignore
|
|
18
|
+
def __init__(self, useragent: str, *args: Any, **kwargs: Any) -> None:
|
|
19
|
+
super().__init__(*args, **kwargs)
|
|
20
|
+
self._useragent = useragent
|
|
21
|
+
|
|
22
|
+
def sending_headers(self) -> dict[str, str]:
|
|
23
|
+
return {"x-gds-user-agent": self._useragent}
|
|
24
|
+
|
|
25
|
+
def received_headers(self, headers: dict[str, Any]) -> None:
|
|
26
|
+
pass
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
from graphdatascience.arrow_client.arrow_base_model import ArrowBaseModel
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class JobIdConfig(ArrowBaseModel):
|
|
5
|
+
job_id: str
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class JobStatus(ArrowBaseModel):
|
|
9
|
+
job_id: str
|
|
10
|
+
status: str
|
|
11
|
+
progress: float
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class MutateResult(ArrowBaseModel):
|
|
15
|
+
mutate_millis: int
|
|
16
|
+
node_properties_written: int
|
|
17
|
+
relationships_written: int
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any, Iterator
|
|
3
|
+
|
|
4
|
+
from pyarrow._flight import Result
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def deserialize_single(input_stream: Iterator[Result]) -> dict[str, Any]:
|
|
8
|
+
rows = deserialize(input_stream)
|
|
9
|
+
if len(rows) != 1:
|
|
10
|
+
raise ValueError(f"Expected exactly one result, got {len(rows)}")
|
|
11
|
+
|
|
12
|
+
return rows[0]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
def deserialize(input_stream: Iterator[Result]) -> list[dict[str, Any]]:
|
|
16
|
+
def deserialize_row(row: Result): # type:ignore
|
|
17
|
+
return json.loads(row.body.to_pybytes().decode())
|
|
18
|
+
|
|
19
|
+
return [deserialize_row(row) for row in list(input_stream)]
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any
|
|
3
|
+
|
|
4
|
+
from pandas import ArrowDtype, DataFrame
|
|
5
|
+
from pyarrow._flight import Ticket
|
|
6
|
+
|
|
7
|
+
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
8
|
+
from graphdatascience.arrow_client.v2.api_types import JobIdConfig, JobStatus
|
|
9
|
+
from graphdatascience.arrow_client.v2.data_mapper_utils import deserialize_single
|
|
10
|
+
|
|
11
|
+
JOB_STATUS_ENDPOINT = "v2/jobs.status"
|
|
12
|
+
RESULTS_SUMMARY_ENDPOINT = "v2/results.summary"
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class JobClient:
|
|
16
|
+
@staticmethod
|
|
17
|
+
def run_job_and_wait(client: AuthenticatedArrowClient, endpoint: str, config: dict[str, Any]) -> str:
|
|
18
|
+
job_id = JobClient.run_job(client, endpoint, config)
|
|
19
|
+
JobClient.wait_for_job(client, job_id)
|
|
20
|
+
return job_id
|
|
21
|
+
|
|
22
|
+
@staticmethod
|
|
23
|
+
def run_job(client: AuthenticatedArrowClient, endpoint: str, config: dict[str, Any]) -> str:
|
|
24
|
+
res = client.do_action_with_retry(endpoint, config)
|
|
25
|
+
|
|
26
|
+
single = deserialize_single(res)
|
|
27
|
+
return JobIdConfig(**single).job_id
|
|
28
|
+
|
|
29
|
+
@staticmethod
|
|
30
|
+
def wait_for_job(client: AuthenticatedArrowClient, job_id: str) -> None:
|
|
31
|
+
while True:
|
|
32
|
+
arrow_res = client.do_action_with_retry(JOB_STATUS_ENDPOINT, JobIdConfig(jobId=job_id).dump_camel())
|
|
33
|
+
job_status = JobStatus(**deserialize_single(arrow_res))
|
|
34
|
+
if job_status.status == "Done":
|
|
35
|
+
break
|
|
36
|
+
|
|
37
|
+
@staticmethod
|
|
38
|
+
def get_summary(client: AuthenticatedArrowClient, job_id: str) -> dict[str, Any]:
|
|
39
|
+
res = client.do_action_with_retry(RESULTS_SUMMARY_ENDPOINT, JobIdConfig(jobId=job_id).dump_camel())
|
|
40
|
+
return deserialize_single(res)
|
|
41
|
+
|
|
42
|
+
@staticmethod
|
|
43
|
+
def stream_results(client: AuthenticatedArrowClient, graph_name: str, job_id: str) -> DataFrame:
|
|
44
|
+
payload = {
|
|
45
|
+
"graphName": graph_name,
|
|
46
|
+
"jobId": job_id,
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
res = client.do_action_with_retry("v2/results.stream", payload)
|
|
50
|
+
export_job_id = JobIdConfig(**deserialize_single(res)).job_id
|
|
51
|
+
|
|
52
|
+
stream_payload = {"version": "v2", "name": export_job_id, "body": {}}
|
|
53
|
+
|
|
54
|
+
ticket = Ticket(json.dumps(stream_payload).encode("utf-8"))
|
|
55
|
+
|
|
56
|
+
get = client.get_stream(ticket)
|
|
57
|
+
arrow_table = get.read_all()
|
|
58
|
+
return arrow_table.to_pandas(types_mapper=ArrowDtype) # type: ignore
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import math
|
|
2
|
+
import time
|
|
3
|
+
|
|
4
|
+
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
5
|
+
from graphdatascience.arrow_client.v2.api_types import MutateResult
|
|
6
|
+
from graphdatascience.arrow_client.v2.data_mapper_utils import deserialize_single
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
class MutationClient:
|
|
10
|
+
MUTATE_ENDPOINT = "v2/results.mutate"
|
|
11
|
+
|
|
12
|
+
@staticmethod
|
|
13
|
+
def mutate_node_property(client: AuthenticatedArrowClient, job_id: str, mutate_property: str) -> MutateResult:
|
|
14
|
+
mutate_config = {"jobId": job_id, "mutateProperty": mutate_property}
|
|
15
|
+
start_time = time.time()
|
|
16
|
+
mutate_arrow_res = client.do_action_with_retry(MutationClient.MUTATE_ENDPOINT, mutate_config)
|
|
17
|
+
mutate_millis = math.ceil((time.time() - start_time) * 1000)
|
|
18
|
+
return MutateResult(mutateMillis=mutate_millis, **deserialize_single(mutate_arrow_res))
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import time
|
|
4
|
+
from typing import Any, Optional
|
|
5
|
+
|
|
6
|
+
from graphdatascience import QueryRunner
|
|
7
|
+
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
8
|
+
from graphdatascience.call_parameters import CallParameters
|
|
9
|
+
from graphdatascience.procedure_surface.api.base_result import BaseResult
|
|
10
|
+
from graphdatascience.query_runner.protocol.write_protocols import WriteProtocol
|
|
11
|
+
from graphdatascience.query_runner.termination_flag import TerminationFlagNoop
|
|
12
|
+
from graphdatascience.session.dbms.protocol_resolver import ProtocolVersionResolver
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class RemoteWriteBackClient:
|
|
16
|
+
def __init__(self, arrow_client: AuthenticatedArrowClient, query_runner: QueryRunner):
|
|
17
|
+
self._arrow_client = arrow_client
|
|
18
|
+
self._query_runner = query_runner
|
|
19
|
+
|
|
20
|
+
protocol_version = ProtocolVersionResolver(query_runner).resolve()
|
|
21
|
+
self._write_protocol = WriteProtocol.select(protocol_version)
|
|
22
|
+
|
|
23
|
+
# TODO: Add progress logging
|
|
24
|
+
def write(
|
|
25
|
+
self,
|
|
26
|
+
graph_name: str,
|
|
27
|
+
job_id: str,
|
|
28
|
+
concurrency: Optional[int] = None,
|
|
29
|
+
property_overwrites: Optional[dict[str, str]] = None,
|
|
30
|
+
relationship_type_overwrite: Optional[str] = None,
|
|
31
|
+
) -> WriteBackResult:
|
|
32
|
+
arrow_config = self._arrow_configuration()
|
|
33
|
+
|
|
34
|
+
configuration: dict[str, Any] = {}
|
|
35
|
+
if concurrency is not None:
|
|
36
|
+
configuration["concurrency"] = concurrency
|
|
37
|
+
if property_overwrites is not None:
|
|
38
|
+
configuration["writeProperties"] = property_overwrites
|
|
39
|
+
if relationship_type_overwrite is not None:
|
|
40
|
+
configuration["writeRelationshipType"] = relationship_type_overwrite
|
|
41
|
+
|
|
42
|
+
write_back_params = CallParameters(
|
|
43
|
+
graphName=graph_name,
|
|
44
|
+
jobId=job_id,
|
|
45
|
+
arrowConfiguration=arrow_config,
|
|
46
|
+
configuration=configuration,
|
|
47
|
+
)
|
|
48
|
+
|
|
49
|
+
start_time = time.time()
|
|
50
|
+
|
|
51
|
+
result = self._write_protocol.run_write_back(
|
|
52
|
+
self._query_runner, write_back_params, None, TerminationFlagNoop()
|
|
53
|
+
).squeeze()
|
|
54
|
+
write_millis = int((time.time() - start_time) * 1000)
|
|
55
|
+
|
|
56
|
+
return WriteBackResult(writeMillis=write_millis, **result.squeeze())
|
|
57
|
+
|
|
58
|
+
def _arrow_configuration(self) -> dict[str, Any]:
|
|
59
|
+
connection_info = self._arrow_client.advertised_connection_info()
|
|
60
|
+
token = self._arrow_client.request_token()
|
|
61
|
+
if token is None:
|
|
62
|
+
token = "IGNORED"
|
|
63
|
+
arrow_config = {
|
|
64
|
+
"host": connection_info.host,
|
|
65
|
+
"port": connection_info.port,
|
|
66
|
+
"token": token,
|
|
67
|
+
"encrypted": connection_info.encrypted,
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return arrow_config
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
class WriteBackResult(BaseResult):
|
|
74
|
+
written_node_properties: int
|
|
75
|
+
written_node_labels: int
|
|
76
|
+
written_relationships: int
|
|
77
|
+
write_millis: int
|
|
78
|
+
status: str
|
|
79
|
+
progress: float
|
{graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/error/cypher_warning_handler.py
RENAMED
|
@@ -19,15 +19,12 @@ def filter_id_func_deprecation_warning() -> Callable[[F], F]:
|
|
|
19
19
|
message=r"^The query used a deprecated function: `id`\.",
|
|
20
20
|
)
|
|
21
21
|
|
|
22
|
+
# previously The query used a deprecated function. ('id' is no longer supported)
|
|
23
|
+
# since 2025.04.0 The query used a deprecated function. ('id' has been replaced by 'elementId or an application-generated id')
|
|
24
|
+
# since 2025.06 The query used a deprecated function. ('id' has been replaced by 'elementId or consider using an application-generated id')
|
|
22
25
|
warnings.filterwarnings(
|
|
23
26
|
"ignore",
|
|
24
|
-
message=r"
|
|
25
|
-
)
|
|
26
|
-
|
|
27
|
-
# since 2025.04.0
|
|
28
|
-
warnings.filterwarnings(
|
|
29
|
-
"ignore",
|
|
30
|
-
message=r"^The query used a deprecated function. \('id' has been replaced by 'elementId or an application-generated id'\)",
|
|
27
|
+
message=r"The query used a deprecated function. \('id'.*",
|
|
31
28
|
)
|
|
32
29
|
|
|
33
30
|
return func(self, *args, **kwargs)
|
{graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_cypher_runner.py
RENAMED
|
@@ -6,6 +6,8 @@ from typing import Any, Optional
|
|
|
6
6
|
|
|
7
7
|
from pandas import Series
|
|
8
8
|
|
|
9
|
+
from graphdatascience.query_runner.query_mode import QueryMode
|
|
10
|
+
|
|
9
11
|
from ..caller_base import CallerBase
|
|
10
12
|
from ..query_runner.query_runner import QueryRunner
|
|
11
13
|
from ..server_version.server_version import ServerVersion
|
|
@@ -45,7 +47,9 @@ class GraphCypherRunner(CallerBase):
|
|
|
45
47
|
|
|
46
48
|
GraphCypherRunner._verify_query_ends_with_return_clause(self._namespace, query)
|
|
47
49
|
|
|
48
|
-
result: Optional[dict[str, Any]] = self._query_runner.
|
|
50
|
+
result: Optional[dict[str, Any]] = self._query_runner.run_retryable_cypher(
|
|
51
|
+
query, params, database, custom_error=False, mode=QueryMode.READ
|
|
52
|
+
).squeeze()
|
|
49
53
|
|
|
50
54
|
if not result:
|
|
51
55
|
raise ValueError("Projected graph cannot be empty.")
|
|
@@ -101,7 +105,7 @@ class GraphCypherRunner(CallerBase):
|
|
|
101
105
|
at_end = True
|
|
102
106
|
break
|
|
103
107
|
|
|
104
|
-
if query_token == "RETURN":
|
|
108
|
+
if query_token.upper() == "RETURN":
|
|
105
109
|
# State 1: We found the start of a `RETURN` clause.
|
|
106
110
|
# Check if it is the `RETURN gds.graph.project` call.
|
|
107
111
|
# We split tokens on `__separators` and flatten the nested iters.
|
{graphdatascience-1.15.1 → graphdatascience-1.17}/graphdatascience/graph/graph_entity_ops_runner.py
RENAMED
|
@@ -5,6 +5,8 @@ from warnings import filterwarnings
|
|
|
5
5
|
import pandas as pd
|
|
6
6
|
from pandas import DataFrame, Series
|
|
7
7
|
|
|
8
|
+
from graphdatascience.query_runner.query_mode import QueryMode
|
|
9
|
+
|
|
8
10
|
from ..call_parameters import CallParameters
|
|
9
11
|
from ..error.cypher_warning_handler import (
|
|
10
12
|
filter_id_func_deprecation_warning,
|
|
@@ -158,12 +160,15 @@ class GraphNodePropertiesRunner(GraphEntityOpsBaseRunner):
|
|
|
158
160
|
duplicate_properties = set(db_node_properties).intersection(set(node_properties))
|
|
159
161
|
if duplicate_properties:
|
|
160
162
|
raise ValueError(
|
|
161
|
-
f"Duplicate property keys '{duplicate_properties}' in db_node_properties and
|
|
163
|
+
f"Duplicate property keys '{duplicate_properties}' in db_node_properties and node_properties."
|
|
162
164
|
)
|
|
163
165
|
|
|
164
166
|
unique_node_ids = result["nodeId"].drop_duplicates().tolist()
|
|
165
|
-
|
|
166
|
-
|
|
167
|
+
|
|
168
|
+
db_properties_df = query_runner.run_retryable_cypher(
|
|
169
|
+
GraphNodePropertiesRunner._build_query(db_node_properties),
|
|
170
|
+
params={"ids": unique_node_ids},
|
|
171
|
+
mode=QueryMode.READ,
|
|
167
172
|
)
|
|
168
173
|
|
|
169
174
|
if "propertyValue" not in result.keys():
|
|
@@ -342,7 +347,7 @@ class GraphRelationshipsRunner(GraphEntityOpsBaseRunner):
|
|
|
342
347
|
def stream(self, G: Graph, relationship_types: list[str] = ["*"], **config: Any) -> TopologyDataFrame:
|
|
343
348
|
self._namespace += ".stream"
|
|
344
349
|
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
|
|
345
|
-
result = self._query_runner.call_procedure(endpoint=self._namespace, params=params)
|
|
350
|
+
result = self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
|
|
346
351
|
|
|
347
352
|
return TopologyDataFrame(result)
|
|
348
353
|
|
|
@@ -360,7 +365,9 @@ class GraphRelationshipsBetaRunner(GraphEntityOpsBaseRunner):
|
|
|
360
365
|
self._namespace += ".stream"
|
|
361
366
|
params = CallParameters(graph_name=G.name(), relationship_types=relationship_types, config=config)
|
|
362
367
|
|
|
363
|
-
return TopologyDataFrame(
|
|
368
|
+
return TopologyDataFrame(
|
|
369
|
+
self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
|
|
370
|
+
)
|
|
364
371
|
|
|
365
372
|
@property
|
|
366
373
|
@compatible_with("toUndirected", min_inclusive=ServerVersion(2, 3, 0))
|
|
@@ -381,7 +388,7 @@ class GraphPropertyRunner(UncallableNamespace, IllegalAttrChecker):
|
|
|
381
388
|
self._namespace += ".stream"
|
|
382
389
|
params = CallParameters(graph_name=G.name(), graph_property=graph_property, config=config)
|
|
383
390
|
|
|
384
|
-
return self._query_runner.call_procedure(endpoint=self._namespace, params=params)
|
|
391
|
+
return self._query_runner.call_procedure(endpoint=self._namespace, params=params, retryable=True)
|
|
385
392
|
|
|
386
393
|
@compatible_with("drop", min_inclusive=ServerVersion(2, 2, 0))
|
|
387
394
|
@graph_type_check
|