graphdatascience 1.22__py3-none-any.whl → 2.0a2__py3-none-any.whl
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/__init__.py +7 -30
- graphdatascience/arrow_client/arrow_endpoint_version.py +18 -10
- graphdatascience/arrow_client/arrow_info.py +4 -6
- graphdatascience/arrow_client/arrow_table_utils.py +38 -0
- graphdatascience/arrow_client/authenticated_flight_client.py +38 -65
- graphdatascience/arrow_client/v1/gds_arrow_client.py +5 -7
- graphdatascience/arrow_client/v2/gds_arrow_client.py +3 -2
- graphdatascience/arrow_client/v2/job_client.py +1 -1
- graphdatascience/datasets/graph_constructor_func.py +2 -2
- graphdatascience/datasets/nx_loader.py +3 -3
- graphdatascience/datasets/ogb_loader.py +5 -5
- graphdatascience/datasets/simple_file_loader.py +0 -11
- graphdatascience/error/cypher_warning_handler.py +6 -3
- graphdatascience/error/standalone_session_error.py +3 -0
- graphdatascience/graph/__init__.py +3 -0
- graphdatascience/graph/{v2/graph_api.py → graph_api.py} +7 -7
- graphdatascience/graph/{v2/graph_backend.py → graph_backend.py} +1 -1
- graphdatascience/{query_runner/arrow_graph_constructor.py → graph_construction/arrow_v1_graph_constructor.py} +16 -24
- graphdatascience/graph_construction/arrow_v2_graph_constructor.py +102 -0
- graphdatascience/{query_runner → graph_construction}/cypher_graph_constructor.py +32 -146
- graphdatascience/graph_data_science.py +656 -156
- graphdatascience/ignored_server_endpoints.py +0 -6
- graphdatascience/model/model.py +38 -227
- graphdatascience/model/model_catalog_protocol.py +29 -0
- graphdatascience/model/{v2/model_details.py → model_details.py} +1 -1
- graphdatascience/procedure_surface/__init__.py +0 -3
- graphdatascience/procedure_surface/api/base_result.py +1 -1
- graphdatascience/procedure_surface/api/catalog/__init__.py +10 -5
- graphdatascience/procedure_surface/api/catalog/catalog_endpoints.py +41 -29
- graphdatascience/procedure_surface/api/catalog/dataset_endpoints.py +9 -9
- graphdatascience/procedure_surface/api/catalog/graph_export_endpoints.py +142 -0
- graphdatascience/procedure_surface/api/catalog/graph_sampling_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/catalog/node_label_endpoints.py +3 -9
- graphdatascience/procedure_surface/api/catalog/node_properties_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/catalog/relationships_data_frame.py +47 -0
- graphdatascience/procedure_surface/api/catalog/relationships_endpoints.py +12 -11
- graphdatascience/procedure_surface/api/catalog/scale_properties_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/__init__.py +10 -0
- graphdatascience/procedure_surface/api/centrality/articlerank_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/articulationpoints_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/betweenness_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/bridges_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/centrality/celf_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/closeness_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/closeness_harmonic_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/degree_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/eigenvector_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/centrality/hits_endpoints.py +258 -0
- graphdatascience/procedure_surface/api/centrality/pagerank_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/collapse_path_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/community/clique_counting_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/conductance_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/community/hdbscan_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/k1coloring_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/kcore_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/kmeans_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/labelpropagation_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/leiden_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/local_clustering_coefficient_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/louvain_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/maxkcut_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/community/modularity_endpoints.py +4 -4
- graphdatascience/procedure_surface/api/community/modularity_optimization_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/scc_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/sllpa_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/triangle_count_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/community/triangles_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/community/wcc_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/debug_endpoints.py +43 -0
- graphdatascience/procedure_surface/api/estimation_result.py +3 -2
- graphdatascience/procedure_surface/api/job_handle.py +4 -4
- graphdatascience/procedure_surface/api/kge/__init__.py +17 -0
- graphdatascience/procedure_surface/api/kge/kge_endpoints.py +69 -0
- graphdatascience/procedure_surface/api/kge/kge_predict_endpoints.py +218 -0
- graphdatascience/procedure_surface/api/kge/simple_rel_embedding_model.py +227 -0
- graphdatascience/procedure_surface/api/license_endpoints.py +23 -0
- graphdatascience/procedure_surface/api/memory_endpoints.py +46 -0
- graphdatascience/procedure_surface/api/model/model_catalog_endpoints.py +2 -1
- graphdatascience/procedure_surface/api/node_embedding/__init__.py +8 -0
- graphdatascience/procedure_surface/api/node_embedding/fastpath_endpoints.py +289 -0
- graphdatascience/procedure_surface/api/node_embedding/fastrp_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/node_embedding/graphsage_endpoints.py +12 -5
- graphdatascience/procedure_surface/api/{model → node_embedding}/graphsage_model.py +14 -14
- graphdatascience/procedure_surface/api/node_embedding/graphsage_predict_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/node_embedding/graphsage_train_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/node_embedding/hashgnn_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/node_embedding/node2vec_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/__init__.py +2 -0
- graphdatascience/procedure_surface/api/pathfinding/all_shortest_path_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/pathfinding/bfs_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/dag_endpoints.py +7 -0
- graphdatascience/procedure_surface/api/pathfinding/dfs_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/dijkstra_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/k_spanning_tree_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/pathfinding/longest_path_endpoints.py +2 -2
- graphdatascience/procedure_surface/api/pathfinding/max_flow_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/max_flow_min_cost_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/prize_steiner_tree_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/random_walk_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/single_source_bellman_ford_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/single_source_delta_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/single_source_dijkstra_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/source_target_astar_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/source_target_dijkstra_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/source_target_yens_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pathfinding/spanning_tree_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/steiner_tree_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/pathfinding/topological_sort_endpoints.py +54 -0
- graphdatascience/procedure_surface/api/pipeline/__init__.py +4 -2
- graphdatascience/procedure_surface/api/{model → pipeline}/link_prediction_model.py +10 -10
- graphdatascience/procedure_surface/api/pipeline/link_prediction_pipeline.py +11 -5
- graphdatascience/procedure_surface/api/pipeline/link_prediction_predict_endpoints.py +137 -4
- graphdatascience/procedure_surface/api/pipeline/link_prediction_train_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/{model → pipeline}/node_classification_model.py +13 -11
- graphdatascience/procedure_surface/api/pipeline/node_classification_pipeline.py +14 -6
- graphdatascience/procedure_surface/api/pipeline/node_classification_pipeline_results.py +1 -0
- graphdatascience/procedure_surface/api/pipeline/node_classification_predict_endpoints.py +5 -5
- graphdatascience/procedure_surface/api/pipeline/node_classification_train_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/{model → pipeline}/node_regression_model.py +9 -9
- graphdatascience/procedure_surface/api/pipeline/node_regression_pipeline.py +11 -5
- graphdatascience/procedure_surface/api/pipeline/node_regression_pipeline_endpoints.py +9 -7
- graphdatascience/procedure_surface/api/pipeline/node_regression_pipeline_protocol.py +4 -4
- graphdatascience/procedure_surface/api/pipeline/node_regression_predict_endpoints.py +3 -3
- graphdatascience/procedure_surface/api/pipeline/pipeline_catalog_protocol.py +8 -1
- graphdatascience/procedure_surface/api/pipeline/pipeline_catalog_result.py +19 -0
- graphdatascience/procedure_surface/api/pipeline/pipeline_endpoints.py +14 -15
- graphdatascience/procedure_surface/api/pipeline/pipeline_info_mapping.py +33 -0
- graphdatascience/procedure_surface/api/pipeline/pipeline_model.py +52 -0
- graphdatascience/procedure_surface/api/projection_job_handle.py +3 -3
- graphdatascience/procedure_surface/api/similarity/__init__.py +2 -0
- graphdatascience/procedure_surface/api/similarity/knn_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/similarity/knn_filtered_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/similarity/node_similarity_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/similarity/node_similarity_filtered_endpoints.py +6 -6
- graphdatascience/procedure_surface/api/similarity/similarity_functions.py +186 -0
- graphdatascience/procedure_surface/api/topological_link_prediction_endpoints.py +187 -0
- graphdatascience/procedure_surface/api/util_endpoints.py +114 -0
- graphdatascience/procedure_surface/api/write_job_handle.py +8 -3
- graphdatascience/procedure_surface/arrow/catalog/__init__.py +1 -2
- graphdatascience/procedure_surface/arrow/catalog/catalog_arrow_endpoints.py +55 -341
- graphdatascience/procedure_surface/arrow/catalog/graph_backend_arrow.py +5 -4
- graphdatascience/procedure_surface/arrow/catalog/graph_export_arrow_endpoints.py +49 -0
- graphdatascience/procedure_surface/arrow/catalog/graph_ops_arrow.py +1 -1
- graphdatascience/procedure_surface/arrow/catalog/graph_sampling_arrow_endpoints.py +4 -4
- graphdatascience/procedure_surface/arrow/catalog/node_label_arrow_endpoints.py +4 -8
- graphdatascience/procedure_surface/arrow/catalog/node_properties_arrow_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/catalog/projection_arrow_endpoints.py +300 -0
- graphdatascience/procedure_surface/arrow/catalog/relationship_arrow_endpoints.py +11 -12
- graphdatascience/procedure_surface/arrow/catalog/scale_properties_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/centrality/articlerank_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/articulationpoints_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/betweenness_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/bridges_arrow_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/centrality/celf_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/closeness_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/closeness_harmonic_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/degree_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/eigenvector_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/centrality/pagerank_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/collapse_path_arrow_endpoints.py +2 -2
- graphdatascience/procedure_surface/arrow/community/clique_counting_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/conductance_arrow_endpoints.py +3 -3
- graphdatascience/procedure_surface/arrow/community/hdbscan_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/k1coloring_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/kcore_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/kmeans_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/labelpropagation_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/leiden_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/local_clustering_coefficient_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/louvain_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/maxkcut_arrow_endpoints.py +6 -6
- graphdatascience/procedure_surface/arrow/community/modularity_arrow_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/community/modularity_optimization_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/scc_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/sllpa_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/triangle_count_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/community/triangles_arrow_endpoints.py +2 -2
- graphdatascience/procedure_surface/arrow/community/wcc_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/endpoints_helper_base.py +8 -8
- graphdatascience/procedure_surface/arrow/jobs_arrow_endpoints.py +3 -3
- graphdatascience/procedure_surface/arrow/model/model_catalog_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/node_embedding/fastpath_arrow_endpoints.py +286 -0
- graphdatascience/procedure_surface/arrow/node_embedding/fastrp_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_predict_arrow_endpoints.py +7 -9
- graphdatascience/procedure_surface/arrow/node_embedding/graphsage_train_arrow_endpoints.py +10 -10
- graphdatascience/procedure_surface/arrow/node_embedding/hashgnn_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/node_embedding/node2vec_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/node_property_endpoints.py +2 -2
- graphdatascience/procedure_surface/arrow/pathfinding/all_shortest_path_arrow_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/pathfinding/bfs_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/dag_arrow_endpoints.py +9 -0
- graphdatascience/procedure_surface/arrow/pathfinding/dfs_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/dijkstra_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/k_spanning_tree_arrow_endpoints.py +4 -4
- graphdatascience/procedure_surface/arrow/pathfinding/longest_path_arrow_endpoints.py +3 -3
- graphdatascience/procedure_surface/arrow/pathfinding/max_flow_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/max_flow_min_cost_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/prize_steiner_tree_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/random_walk_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/shortest_path_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_bellman_ford_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_delta_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/single_source_dijkstra_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_astar_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_dijkstra_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/source_target_yens_arrow_endpoints.py +7 -7
- graphdatascience/procedure_surface/arrow/pathfinding/spanning_tree_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/steiner_tree_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/pathfinding/topological_sort_arrow_endpoints.py +51 -0
- graphdatascience/procedure_surface/arrow/pipeline/link_prediction_pipeline_arrow_endpoints.py +7 -9
- graphdatascience/procedure_surface/arrow/pipeline/link_prediction_predict_arrow_endpoints.py +5 -5
- graphdatascience/procedure_surface/arrow/pipeline/link_prediction_train_arrow_endpoints.py +10 -10
- graphdatascience/procedure_surface/arrow/pipeline/node_classification_pipeline_arrow_endpoints.py +7 -9
- graphdatascience/procedure_surface/arrow/pipeline/node_classification_predict_arrow_endpoints.py +6 -6
- graphdatascience/procedure_surface/arrow/pipeline/node_classification_train_arrow_endpoints.py +10 -10
- graphdatascience/procedure_surface/arrow/pipeline/node_regression_pipeline_arrow_endpoints.py +11 -13
- graphdatascience/procedure_surface/arrow/pipeline/node_regression_predict_arrow_endpoints.py +4 -4
- graphdatascience/procedure_surface/arrow/pipeline/pipeline_arrow_endpoints.py +1 -1
- graphdatascience/procedure_surface/arrow/pipeline/pipeline_catalog_arrow_endpoints.py +12 -6
- graphdatascience/procedure_surface/arrow/relationship_endpoints_helper.py +2 -2
- graphdatascience/procedure_surface/arrow/similarity/knn_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/similarity/knn_filtered_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/similarity/node_similarity_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/similarity/node_similarity_filtered_arrow_endpoints.py +8 -8
- graphdatascience/procedure_surface/arrow/stream_result_mapper.py +8 -0
- graphdatascience/procedure_surface/arrow/topological_link_prediction_arrow_endpoints.py +65 -0
- graphdatascience/procedure_surface/arrow/util_arrow_endpoints.py +55 -0
- graphdatascience/procedure_surface/cypher/catalog/__init__.py +8 -0
- graphdatascience/procedure_surface/cypher/catalog/catalog_cypher_endpoints.py +83 -93
- graphdatascience/{graph/v2 → procedure_surface/cypher/catalog}/graph_backend_cypher.py +14 -7
- graphdatascience/procedure_surface/cypher/catalog/graph_export_cypher_endpoints.py +97 -0
- graphdatascience/procedure_surface/cypher/catalog/graph_sampling_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/catalog/node_label_cypher_endpoints.py +8 -18
- graphdatascience/procedure_surface/cypher/catalog/node_properties_cypher_endpoints.py +8 -8
- graphdatascience/procedure_surface/cypher/catalog/projection_cypher_endpoints.py +201 -0
- graphdatascience/procedure_surface/cypher/catalog/relationship_cypher_endpoints.py +38 -26
- graphdatascience/procedure_surface/cypher/catalog/scale_properties_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/catalog/utils.py +20 -0
- graphdatascience/procedure_surface/cypher/centrality/articlerank_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/articulationpoints_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/betweenness_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/bridges_cypher_endpoints.py +3 -3
- graphdatascience/procedure_surface/cypher/centrality/celf_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/closeness_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/closeness_harmonic_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/degree_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/eigenvector_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/centrality/hits_cypher_endpoints.py +179 -0
- graphdatascience/procedure_surface/cypher/centrality/pagerank_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/collapse_path_cypher_endpoints.py +4 -4
- graphdatascience/procedure_surface/cypher/community/clique_counting_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/conductance_cypher_endpoints.py +2 -2
- graphdatascience/procedure_surface/cypher/community/hdbscan_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/community/k1coloring_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/kcore_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/kmeans_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/labelpropagation_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/leiden_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/local_clustering_coefficient_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/louvain_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/maxkcut_cypher_endpoints.py +6 -6
- graphdatascience/procedure_surface/cypher/community/modularity_cypher_endpoints.py +5 -5
- graphdatascience/procedure_surface/cypher/community/modularity_optimization_cypher_endpoints.py +9 -11
- graphdatascience/procedure_surface/cypher/community/scc_cypher_endpoints.py +14 -14
- graphdatascience/procedure_surface/cypher/community/sllpa_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/community/triangle_count_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/community/triangles_cypher_endpoints.py +2 -2
- graphdatascience/procedure_surface/cypher/community/wcc_cypher_endpoints.py +14 -14
- graphdatascience/procedure_surface/cypher/config_cypher_endpoints.py +2 -2
- graphdatascience/procedure_surface/cypher/debug_cypher_endpoints.py +15 -0
- graphdatascience/procedure_surface/cypher/estimation_utils.py +5 -5
- graphdatascience/procedure_surface/cypher/kge/__init__.py +5 -0
- graphdatascience/procedure_surface/cypher/kge/kge_predict_cypher_endpoints.py +148 -0
- graphdatascience/procedure_surface/cypher/license_cypher_endpoints.py +22 -0
- graphdatascience/procedure_surface/cypher/list_progress_cypher_endpoint.py +1 -1
- graphdatascience/procedure_surface/cypher/memory_cypher_endpoints.py +21 -0
- graphdatascience/procedure_surface/cypher/model/model_catalog_cypher_endpoints.py +7 -6
- graphdatascience/procedure_surface/cypher/node_embedding/fastrp_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/node_embedding/graphsage_predict_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/node_embedding/graphsage_train_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/node_embedding/hashgnn_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/node_embedding/node2vec_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/pathfinding/all_shortest_path_cypher_endpoints.py +3 -3
- graphdatascience/procedure_surface/cypher/pathfinding/bfs_cypher_endpoints.py +13 -13
- graphdatascience/procedure_surface/cypher/pathfinding/dag_cypher_endpoints.py +9 -0
- graphdatascience/procedure_surface/cypher/pathfinding/dfs_cypher_endpoints.py +13 -13
- graphdatascience/procedure_surface/cypher/pathfinding/dijkstra_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pathfinding/k_spanning_tree_cypher_endpoints.py +5 -5
- graphdatascience/procedure_surface/cypher/pathfinding/longest_path_cypher_endpoints.py +2 -2
- graphdatascience/procedure_surface/cypher/pathfinding/max_flow_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/pathfinding/max_flow_min_cost_cypher_endpoints.py +12 -12
- graphdatascience/procedure_surface/cypher/pathfinding/prize_steiner_tree_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/pathfinding/random_walk_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/pathfinding/single_source_bellman_ford_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/pathfinding/single_source_delta_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/pathfinding/single_source_dijkstra_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pathfinding/source_target_astar_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pathfinding/source_target_dijkstra_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pathfinding/source_target_yens_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pathfinding/spanning_tree_cypher_endpoints.py +15 -15
- graphdatascience/procedure_surface/cypher/pathfinding/steiner_tree_cypher_endpoints.py +11 -15
- graphdatascience/procedure_surface/cypher/pathfinding/topological_sort_cypher_endpoints.py +47 -0
- graphdatascience/procedure_surface/cypher/pipeline/link_prediction_pipeline_cypher_endpoints.py +19 -21
- graphdatascience/procedure_surface/cypher/pipeline/link_prediction_predict_cypher_endpoints.py +7 -7
- graphdatascience/procedure_surface/cypher/pipeline/link_prediction_train_cypher_endpoints.py +11 -11
- graphdatascience/procedure_surface/cypher/pipeline/node_classification_pipeline_cypher_endpoints.py +19 -21
- graphdatascience/procedure_surface/cypher/pipeline/node_classification_predict_cypher_endpoints.py +10 -10
- graphdatascience/procedure_surface/cypher/pipeline/node_classification_train_cypher_endpoints.py +11 -11
- graphdatascience/procedure_surface/cypher/pipeline/node_regression_pipeline_cypher_endpoints.py +26 -28
- graphdatascience/procedure_surface/cypher/pipeline/node_regression_predict_cypher_endpoints.py +5 -5
- graphdatascience/procedure_surface/cypher/pipeline/pipeline_catalog_cypher_endpoints.py +13 -7
- graphdatascience/procedure_surface/cypher/similarity/knn_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/similarity/knn_filtered_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/similarity/node_similarity_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/similarity/node_similarity_filtered_cypher_endpoints.py +9 -9
- graphdatascience/procedure_surface/cypher/topological_link_prediction_cypher_endpoints.py +138 -0
- graphdatascience/procedure_surface/cypher/util_cypher_endpoints.py +42 -0
- graphdatascience/procedure_surface/utils/node_matching.py +37 -0
- graphdatascience/procedure_surface/utils/result_utils.py +5 -0
- graphdatascience/{query_runner/progress → progress}/progress_bar.py +15 -4
- graphdatascience/{query_runner/progress → progress}/query_progress_logger.py +3 -9
- graphdatascience/{query_runner/progress → progress}/query_progress_provider.py +2 -11
- graphdatascience/query_runner/neo4j_query_runner.py +21 -81
- graphdatascience/query_runner/query_runner.py +1 -8
- graphdatascience/retry_utils/neo4j_retry_helper.py +0 -3
- graphdatascience/session/aura_api.py +12 -3
- graphdatascience/session/aura_api_responses.py +13 -2
- graphdatascience/session/aura_api_token_authentication.py +1 -1
- graphdatascience/session/aura_graph_data_science.py +751 -146
- graphdatascience/session/endpoint_mappings.py +42 -0
- graphdatascience/session/gds_sessions.py +246 -22
- graphdatascience/{query_runner/protocol → session/remote_ops}/project_protocols.py +22 -24
- graphdatascience/{query_runner/protocol → session/remote_ops}/projection_runner.py +15 -4
- graphdatascience/{query_runner/protocol → session/remote_ops}/write_protocols.py +3 -3
- graphdatascience/session/session_lifecycle_manager.py +22 -1
- graphdatascience/version.py +2 -2
- graphdatascience/versions/__init__.py +4 -0
- {graphdatascience-1.22.dist-info → graphdatascience-2.0a2.dist-info}/METADATA +8 -8
- graphdatascience-2.0a2.dist-info/RECORD +458 -0
- {graphdatascience-1.22.dist-info → graphdatascience-2.0a2.dist-info}/WHEEL +1 -1
- graphdatascience/algo/algo_endpoints.py +0 -24
- graphdatascience/algo/algo_proc_runner.py +0 -45
- graphdatascience/algo/single_mode_algo_endpoints.py +0 -18
- graphdatascience/call_builder.py +0 -21
- graphdatascience/caller_base.py +0 -23
- graphdatascience/endpoints.py +0 -116
- graphdatascience/error/client_only_endpoint.py +0 -47
- graphdatascience/error/endpoint_suggester.py +0 -29
- graphdatascience/error/illegal_attr_checker.py +0 -16
- graphdatascience/error/uncallable_namespace.py +0 -16
- graphdatascience/graph/base_graph_proc_runner.py +0 -570
- graphdatascience/graph/graph_alpha_proc_runner.py +0 -81
- graphdatascience/graph/graph_beta_proc_runner.py +0 -43
- graphdatascience/graph/graph_create_result.py +0 -28
- graphdatascience/graph/graph_cypher_runner.py +0 -125
- graphdatascience/graph/graph_endpoints.py +0 -15
- graphdatascience/graph/graph_entity_ops_runner.py +0 -426
- graphdatascience/graph/graph_export_runner.py +0 -52
- graphdatascience/graph/graph_object.py +0 -232
- graphdatascience/graph/graph_proc_runner.py +0 -15
- graphdatascience/graph/graph_project_runner.py +0 -72
- graphdatascience/graph/graph_remote_proc_runner.py +0 -76
- graphdatascience/graph/graph_sample_runner.py +0 -72
- graphdatascience/graph/graph_type_check.py +0 -34
- graphdatascience/graph/nx_loader.py +0 -46
- graphdatascience/graph/ogb_loader.py +0 -76
- graphdatascience/graph/v2/__init__.py +0 -4
- graphdatascience/model/graphsage_model.py +0 -56
- graphdatascience/model/link_prediction_model.py +0 -45
- graphdatascience/model/model_alpha_proc_runner.py +0 -51
- graphdatascience/model/model_beta_proc_runner.py +0 -33
- graphdatascience/model/model_endpoints.py +0 -22
- graphdatascience/model/model_proc_runner.py +0 -151
- graphdatascience/model/model_resolver.py +0 -21
- graphdatascience/model/node_classification_model.py +0 -78
- graphdatascience/model/node_regression_model.py +0 -25
- graphdatascience/model/pipeline_model.py +0 -104
- graphdatascience/model/simple_rel_embedding_model.py +0 -196
- graphdatascience/model/v2/model.py +0 -55
- graphdatascience/model/v2/model_api.py +0 -45
- graphdatascience/pipeline/classification_training_pipeline.py +0 -67
- graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -20
- graphdatascience/pipeline/lp_training_pipeline.py +0 -52
- graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -20
- graphdatascience/pipeline/nc_training_pipeline.py +0 -52
- graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -20
- graphdatascience/pipeline/nr_training_pipeline.py +0 -83
- graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -25
- graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -79
- graphdatascience/pipeline/pipeline_endpoints.py +0 -116
- graphdatascience/pipeline/pipeline_proc_runner.py +0 -88
- graphdatascience/pipeline/training_pipeline.py +0 -269
- graphdatascience/plugin_v2_endpoints.py +0 -540
- graphdatascience/procedure_surface/arrow/model_api_arrow.py +0 -57
- graphdatascience/procedure_surface/cypher/model_api_cypher.py +0 -49
- graphdatascience/query_runner/arrow_authentication/__init__.py +0 -3
- graphdatascience/query_runner/arrow_info/__init__.py +0 -5
- graphdatascience/query_runner/arrow_query_runner.py +0 -272
- graphdatascience/query_runner/gds_arrow_client.py +0 -1004
- graphdatascience/query_runner/progress/__init__.py +0 -0
- graphdatascience/query_runner/protocol/__init__.py +0 -0
- graphdatascience/query_runner/session_query_runner.py +0 -231
- graphdatascience/query_runner/standalone_session_query_runner.py +0 -109
- graphdatascience/semantic_version/__init__.py +0 -0
- graphdatascience/server_version/__init__.py +0 -0
- graphdatascience/server_version/compatible_with.py +0 -43
- graphdatascience/session/dedicated_sessions.py +0 -286
- graphdatascience/session/session_v2_endpoints.py +0 -593
- graphdatascience/system/__init__.py +0 -0
- graphdatascience/system/config_endpoints.py +0 -61
- graphdatascience/system/system_endpoints.py +0 -144
- graphdatascience/topological_lp/__init__.py +0 -0
- graphdatascience/topological_lp/topological_lp_alpha_endpoints.py +0 -8
- graphdatascience/topological_lp/topological_lp_alpha_runner.py +0 -52
- graphdatascience/topological_lp/topological_lp_runner.py +0 -72
- graphdatascience/utils/__init__.py +0 -0
- graphdatascience/utils/direct_util_endpoints.py +0 -115
- graphdatascience/utils/util_node_property_func_runner.py +0 -31
- graphdatascience/utils/util_proc_runner.py +0 -60
- graphdatascience/utils/util_remote_proc_runner.py +0 -55
- graphdatascience-1.22.dist-info/RECORD +0 -496
- /graphdatascience/{procedure_surface/api/catalog → graph}/graph_info.py +0 -0
- /graphdatascience/{algo → graph_construction}/__init__.py +0 -0
- /graphdatascience/{query_runner → graph_construction}/graph_constructor.py +0 -0
- /graphdatascience/{model/v2 → progress}/__init__.py +0 -0
- /graphdatascience/{query_runner/progress → progress}/progress_provider.py +0 -0
- /graphdatascience/{query_runner/progress → progress}/static_progress_provider.py +0 -0
- /graphdatascience/{pipeline → session/remote_ops}/__init__.py +0 -0
- /graphdatascience/{query_runner/protocol → session/remote_ops}/arrow_config.py +0 -0
- /graphdatascience/{query_runner/protocol → session/remote_ops}/status.py +0 -0
- /graphdatascience/{semantic_version → versions}/semantic_version.py +0 -0
- /graphdatascience/{server_version → versions}/server_version.py +0 -0
- {graphdatascience-1.22.dist-info → graphdatascience-2.0a2.dist-info}/licenses/LICENSE +0 -0
- {graphdatascience-1.22.dist-info → graphdatascience-2.0a2.dist-info}/top_level.txt +0 -0
graphdatascience/__init__.py
CHANGED
|
@@ -1,36 +1,13 @@
|
|
|
1
|
-
from .graph.
|
|
2
|
-
from .
|
|
3
|
-
from .
|
|
4
|
-
from .
|
|
5
|
-
from .
|
|
6
|
-
from .model.node_classification_model import NCModel
|
|
7
|
-
from .model.node_regression_model import NRModel
|
|
8
|
-
from .model.pipeline_model import NodePropertyStep
|
|
9
|
-
from .model.simple_rel_embedding_model import SimpleRelEmbeddingModel
|
|
10
|
-
from .pipeline.lp_training_pipeline import LPTrainingPipeline
|
|
11
|
-
from .pipeline.nc_training_pipeline import NCTrainingPipeline
|
|
12
|
-
from .pipeline.nr_training_pipeline import NRTrainingPipeline
|
|
13
|
-
from .query_runner.query_runner import QueryRunner
|
|
14
|
-
from .server_version.server_version import ServerVersion
|
|
15
|
-
from .session.gds_sessions import GdsSessions
|
|
16
|
-
from .version import __version__
|
|
1
|
+
from graphdatascience.graph.graph_api import Graph
|
|
2
|
+
from graphdatascience.graph_data_science import GraphDataScience
|
|
3
|
+
from graphdatascience.session import GdsSessions
|
|
4
|
+
from graphdatascience.version import __version__
|
|
5
|
+
from graphdatascience.versions import ServerVersion
|
|
17
6
|
|
|
18
7
|
__all__ = [
|
|
19
|
-
"GraphDataScience",
|
|
20
|
-
"GdsSessions",
|
|
21
|
-
"QueryRunner",
|
|
22
8
|
"__version__",
|
|
23
9
|
"ServerVersion",
|
|
10
|
+
"GraphDataScience",
|
|
11
|
+
"GdsSessions",
|
|
24
12
|
"Graph",
|
|
25
|
-
"GraphCreateResult",
|
|
26
|
-
"LPTrainingPipeline",
|
|
27
|
-
"NCTrainingPipeline",
|
|
28
|
-
"NRTrainingPipeline",
|
|
29
|
-
"NodePropertyStep",
|
|
30
|
-
"LinkFeature",
|
|
31
|
-
"LPModel",
|
|
32
|
-
"NCModel",
|
|
33
|
-
"NRModel",
|
|
34
|
-
"GraphSageModel",
|
|
35
|
-
"SimpleRelEmbeddingModel",
|
|
36
13
|
]
|
|
@@ -2,26 +2,34 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from enum import Enum
|
|
4
4
|
|
|
5
|
+
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
6
|
+
|
|
5
7
|
|
|
6
8
|
class ArrowEndpointVersion(Enum):
|
|
7
|
-
V1 = "v1
|
|
8
|
-
V2 = "v2
|
|
9
|
+
V1 = "v1"
|
|
10
|
+
V2 = "v2"
|
|
9
11
|
|
|
10
12
|
def version(self) -> str:
|
|
11
13
|
return self._name_.lower()
|
|
12
14
|
|
|
13
15
|
def prefix(self) -> str:
|
|
14
|
-
return self._value_
|
|
16
|
+
return f"{self._value_}/"
|
|
15
17
|
|
|
16
18
|
@staticmethod
|
|
17
|
-
def
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
def check_version_compatibility(
|
|
20
|
+
compatible_versions: set[ArrowEndpointVersion], arrow_client: AuthenticatedArrowClient
|
|
21
|
+
) -> None:
|
|
22
|
+
supported_server_versions = {action.type.split("/")[0].lower() for action in arrow_client.list_actions()}
|
|
23
|
+
for version in compatible_versions:
|
|
24
|
+
if version.version() in supported_server_versions:
|
|
25
|
+
return
|
|
21
26
|
|
|
22
|
-
raise UnsupportedArrowEndpointVersion(
|
|
27
|
+
raise UnsupportedArrowEndpointVersion(compatible_versions, supported_server_versions)
|
|
23
28
|
|
|
24
29
|
|
|
25
30
|
class UnsupportedArrowEndpointVersion(Exception):
|
|
26
|
-
def __init__(self,
|
|
27
|
-
super().__init__(
|
|
31
|
+
def __init__(self, compatible_versions: set[ArrowEndpointVersion], supported_server_versions: set[str]) -> None:
|
|
32
|
+
super().__init__(
|
|
33
|
+
self,
|
|
34
|
+
f"The GDS version is not supported by this client version, please update the `graphdatascience` package. Arrow versions supported by this client are: {compatible_versions}, but GDS supports: {supported_server_versions}",
|
|
35
|
+
)
|
|
@@ -4,7 +4,6 @@ from dataclasses import dataclass
|
|
|
4
4
|
|
|
5
5
|
from graphdatascience.query_runner.query_runner import QueryRunner
|
|
6
6
|
from graphdatascience.query_runner.query_type import QueryType
|
|
7
|
-
from graphdatascience.server_version.server_version import ServerVersion
|
|
8
7
|
|
|
9
8
|
|
|
10
9
|
@dataclass(frozen=True)
|
|
@@ -16,12 +15,11 @@ class ArrowInfo:
|
|
|
16
15
|
|
|
17
16
|
@staticmethod
|
|
18
17
|
def create(query_runner: QueryRunner) -> ArrowInfo:
|
|
19
|
-
debugYields = ["listenAddress", "enabled", "running"]
|
|
20
|
-
if query_runner.server_version() > ServerVersion(2, 6, 0):
|
|
21
|
-
debugYields.append("versions")
|
|
22
|
-
|
|
23
18
|
procResult = query_runner.call_procedure(
|
|
24
|
-
endpoint="gds.debug.arrow",
|
|
19
|
+
endpoint="gds.debug.arrow",
|
|
20
|
+
query_type=QueryType.SYSTEM,
|
|
21
|
+
custom_error=False,
|
|
22
|
+
yields=["listenAddress", "enabled", "running", "versions"],
|
|
25
23
|
).iloc[0]
|
|
26
24
|
|
|
27
25
|
return ArrowInfo(
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
from __future__ import annotations
|
|
2
|
+
|
|
3
|
+
import pandas
|
|
4
|
+
import pyarrow
|
|
5
|
+
from pyarrow import types as pa_types
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
def _downcast_type(data_type: pyarrow.DataType) -> pyarrow.DataType:
|
|
9
|
+
"""Map pyarrow "large" string/binary types back to their 32-bit variants.
|
|
10
|
+
|
|
11
|
+
pandas 3.0 introduced a default string dtype that ``pyarrow.Table.from_pandas``
|
|
12
|
+
maps to ``large_string`` (LargeUTF8), whereas pandas 2.x produced ``string``
|
|
13
|
+
(UTF8). The GDS server expects UTF8, so we coerce the large variants back.
|
|
14
|
+
List containers are preserved as-is, only their element type is downcast.
|
|
15
|
+
"""
|
|
16
|
+
if pa_types.is_large_string(data_type):
|
|
17
|
+
return pyarrow.string()
|
|
18
|
+
|
|
19
|
+
return data_type
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
def table_from_pandas(data: pandas.DataFrame) -> pyarrow.Table:
|
|
23
|
+
"""Convert a DataFrame to a pyarrow Table, coercing large string/binary types to UTF8/binary.
|
|
24
|
+
|
|
25
|
+
Use this instead of ``pyarrow.Table.from_pandas`` so the produced schema stays
|
|
26
|
+
consistent across pandas 2.x and 3.0 (see :func:`_downcast_type`).
|
|
27
|
+
"""
|
|
28
|
+
table = pyarrow.Table.from_pandas(data)
|
|
29
|
+
|
|
30
|
+
new_types = [_downcast_type(field.type) for field in table.schema]
|
|
31
|
+
if all(new_type == field.type for new_type, field in zip(new_types, table.schema)):
|
|
32
|
+
return table
|
|
33
|
+
|
|
34
|
+
new_schema = pyarrow.schema(
|
|
35
|
+
[field.with_type(new_type) for field, new_type in zip(table.schema, new_types)],
|
|
36
|
+
metadata=table.schema.metadata,
|
|
37
|
+
)
|
|
38
|
+
return table.cast(new_schema)
|
|
@@ -22,7 +22,6 @@ from pyarrow.flight import (
|
|
|
22
22
|
)
|
|
23
23
|
|
|
24
24
|
from graphdatascience.arrow_client.arrow_authentication import ArrowAuthentication
|
|
25
|
-
from graphdatascience.arrow_client.arrow_info import ArrowInfo
|
|
26
25
|
from graphdatascience.retry_utils.retry_config import ExponentialWaitConfig, RetryConfigV2, StopConfig
|
|
27
26
|
|
|
28
27
|
from ..version import __version__
|
|
@@ -32,100 +31,66 @@ from .middleware.user_agent_middleware import UserAgentFactory
|
|
|
32
31
|
|
|
33
32
|
|
|
34
33
|
class AuthenticatedArrowClient:
|
|
35
|
-
@staticmethod
|
|
36
|
-
def create(
|
|
37
|
-
arrow_info: ArrowInfo,
|
|
38
|
-
auth: ArrowAuthentication | None = None,
|
|
39
|
-
encrypted: bool = False,
|
|
40
|
-
arrow_client_options: dict[str, Any] | None = None,
|
|
41
|
-
connection_string_override: str | None = None,
|
|
42
|
-
retry_config: RetryConfigV2 | None = None,
|
|
43
|
-
advertised_listen_address: tuple[str, int] | None = None,
|
|
44
|
-
) -> AuthenticatedArrowClient:
|
|
45
|
-
connection_string: str
|
|
46
|
-
if connection_string_override is not None:
|
|
47
|
-
connection_string = connection_string_override
|
|
48
|
-
else:
|
|
49
|
-
connection_string = arrow_info.listenAddress
|
|
50
|
-
|
|
51
|
-
host, port = connection_string.split(":")
|
|
52
|
-
|
|
53
|
-
if retry_config is None:
|
|
54
|
-
retry_config = RetryConfigV2(
|
|
55
|
-
retryable_exceptions=[
|
|
56
|
-
FlightTimedOutError,
|
|
57
|
-
FlightUnavailableError,
|
|
58
|
-
FlightInternalError,
|
|
59
|
-
],
|
|
60
|
-
stop_config=StopConfig(after_delay=10, after_attempt=5),
|
|
61
|
-
wait_config=ExponentialWaitConfig(multiplier=1, min=1, max=10),
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
return AuthenticatedArrowClient(
|
|
65
|
-
host=host,
|
|
66
|
-
retry_config=retry_config,
|
|
67
|
-
port=int(port),
|
|
68
|
-
auth=auth,
|
|
69
|
-
encrypted=encrypted,
|
|
70
|
-
arrow_client_options=arrow_client_options,
|
|
71
|
-
advertised_listen_address=advertised_listen_address,
|
|
72
|
-
)
|
|
73
|
-
|
|
74
34
|
def __init__(
|
|
75
35
|
self,
|
|
76
|
-
|
|
77
|
-
retry_config: RetryConfigV2,
|
|
78
|
-
port: int = 8491,
|
|
36
|
+
connection_info: str | tuple[str, int],
|
|
79
37
|
auth: ArrowAuthentication | None = None,
|
|
80
38
|
encrypted: bool = False,
|
|
81
39
|
arrow_client_options: dict[str, Any] | None = None,
|
|
82
40
|
user_agent: str | None = None,
|
|
83
41
|
advertised_listen_address: tuple[str, int] | None = None,
|
|
42
|
+
retry_config: RetryConfigV2 | None = None,
|
|
84
43
|
):
|
|
85
44
|
"""Creates a new AuthenticatedArrowClient instance.
|
|
86
45
|
|
|
87
46
|
Parameters
|
|
88
47
|
----------
|
|
89
|
-
|
|
90
|
-
The host address of the GDS Arrow server
|
|
91
|
-
|
|
92
|
-
The host port of the GDS Arrow server (default is 8491)
|
|
93
|
-
auth: ArrowAuthentication | None
|
|
48
|
+
connection_info
|
|
49
|
+
The host address and port of the GDS Arrow server
|
|
50
|
+
auth
|
|
94
51
|
An implementation of ArrowAuthentication providing a pair to be used for basic authentication
|
|
95
|
-
encrypted
|
|
52
|
+
encrypted
|
|
96
53
|
A flag that indicates whether the connection should be encrypted (default is False)
|
|
97
|
-
arrow_client_options
|
|
54
|
+
arrow_client_options
|
|
98
55
|
Additional options to be passed to the Arrow Flight client.
|
|
99
|
-
user_agent
|
|
56
|
+
user_agent
|
|
100
57
|
The user agent string to use for the connection. (default is `neo4j-graphdatascience-v[VERSION] pyarrow-v[PYARROW_VERSION])
|
|
101
|
-
retry_config
|
|
58
|
+
retry_config
|
|
102
59
|
The retry configuration to use for the Arrow requests send by the client.
|
|
103
|
-
advertised_listen_address
|
|
60
|
+
advertised_listen_address
|
|
104
61
|
The advertised listen address of the GDS Arrow server. This will be used by remote projection and writeback operations.
|
|
105
62
|
"""
|
|
63
|
+
|
|
64
|
+
if isinstance(connection_info, str):
|
|
65
|
+
host, port_str = connection_info.split(":")
|
|
66
|
+
port = int(port_str)
|
|
67
|
+
else:
|
|
68
|
+
host, port = connection_info
|
|
69
|
+
|
|
70
|
+
if retry_config is None:
|
|
71
|
+
retry_config = RetryConfigV2(
|
|
72
|
+
retryable_exceptions=[
|
|
73
|
+
FlightTimedOutError,
|
|
74
|
+
FlightUnavailableError,
|
|
75
|
+
FlightInternalError,
|
|
76
|
+
],
|
|
77
|
+
stop_config=StopConfig(after_delay=10, after_attempt=5),
|
|
78
|
+
wait_config=ExponentialWaitConfig(multiplier=1, min=1, max=10),
|
|
79
|
+
)
|
|
80
|
+
|
|
106
81
|
self._host = host
|
|
107
|
-
self._port = port
|
|
108
|
-
self._auth =
|
|
82
|
+
self._port = int(port)
|
|
83
|
+
self._auth = auth
|
|
109
84
|
self._encrypted = encrypted
|
|
110
85
|
self._arrow_client_options = arrow_client_options
|
|
111
86
|
self._user_agent = user_agent
|
|
112
87
|
self._logger = logging.getLogger("gds_arrow_client")
|
|
113
88
|
self._retry_config = retry_config
|
|
114
89
|
if auth:
|
|
115
|
-
self._auth = auth
|
|
116
90
|
self._auth_middleware = AuthMiddleware(auth)
|
|
117
91
|
self.advertised_listen_address = advertised_listen_address
|
|
118
|
-
|
|
119
92
|
self._flight_client: flight.FlightClient = self._instantiate_flight_client()
|
|
120
93
|
|
|
121
|
-
def _reconnect(self) -> None:
|
|
122
|
-
try:
|
|
123
|
-
self._flight_client.close()
|
|
124
|
-
except Exception:
|
|
125
|
-
pass
|
|
126
|
-
|
|
127
|
-
self._flight_client = self._instantiate_flight_client()
|
|
128
|
-
|
|
129
94
|
def connection_info(self) -> ConnectionInfo:
|
|
130
95
|
"""
|
|
131
96
|
Returns the host and port of the GDS Arrow server.
|
|
@@ -267,6 +232,14 @@ class AuthenticatedArrowClient:
|
|
|
267
232
|
self.__dict__.update(state)
|
|
268
233
|
self._flight_client = self._instantiate_flight_client()
|
|
269
234
|
|
|
235
|
+
def _reconnect(self) -> None:
|
|
236
|
+
try:
|
|
237
|
+
self._flight_client.close()
|
|
238
|
+
except Exception:
|
|
239
|
+
pass
|
|
240
|
+
|
|
241
|
+
self._flight_client = self._instantiate_flight_client()
|
|
242
|
+
|
|
270
243
|
|
|
271
244
|
@dataclass
|
|
272
245
|
class ConnectionInfo:
|
|
@@ -12,11 +12,11 @@ from pyarrow.types import is_dictionary
|
|
|
12
12
|
from pydantic import BaseModel
|
|
13
13
|
|
|
14
14
|
from graphdatascience.arrow_client.arrow_endpoint_version import ArrowEndpointVersion
|
|
15
|
+
from graphdatascience.arrow_client.arrow_table_utils import table_from_pandas
|
|
15
16
|
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient, ConnectionInfo
|
|
16
17
|
from graphdatascience.arrow_client.v1.data_mapper_utils import deserialize_single
|
|
17
18
|
|
|
18
19
|
from ...procedure_surface.arrow.error_handler import handle_flight_error
|
|
19
|
-
from ...semantic_version.semantic_version import SemanticVersion
|
|
20
20
|
from ..progress_callback import ProgressCallback
|
|
21
21
|
|
|
22
22
|
|
|
@@ -487,11 +487,13 @@ class GdsArrowClient:
|
|
|
487
487
|
batch_size: int,
|
|
488
488
|
progress_callback: ProgressCallback,
|
|
489
489
|
) -> None:
|
|
490
|
+
batches: list[RecordBatch]
|
|
490
491
|
match data:
|
|
491
492
|
case pyarrow.Table():
|
|
492
493
|
batches = data.to_batches(batch_size)
|
|
493
494
|
case pandas.DataFrame():
|
|
494
|
-
batches =
|
|
495
|
+
batches = table_from_pandas(data).to_batches(batch_size)
|
|
496
|
+
|
|
495
497
|
case _:
|
|
496
498
|
batches = data
|
|
497
499
|
|
|
@@ -562,11 +564,7 @@ class GdsArrowClient:
|
|
|
562
564
|
except Exception as e:
|
|
563
565
|
handle_flight_error(e)
|
|
564
566
|
arrow_table = self._sanitize_arrow_table(arrow_table)
|
|
565
|
-
|
|
566
|
-
return arrow_table.to_pandas(types_mapper=pandas.ArrowDtype) # type: ignore
|
|
567
|
-
else:
|
|
568
|
-
arrow_table = self._sanitize_arrow_table(arrow_table)
|
|
569
|
-
return arrow_table.to_pandas() # type: ignore
|
|
567
|
+
return arrow_table.to_pandas(types_mapper=pandas.ArrowDtype) # type: ignore
|
|
570
568
|
|
|
571
569
|
def __enter__(self) -> GdsArrowClient:
|
|
572
570
|
return self
|
|
@@ -10,6 +10,7 @@ import pyarrow
|
|
|
10
10
|
from pyarrow import RecordBatch, flight
|
|
11
11
|
|
|
12
12
|
from graphdatascience.arrow_client.arrow_endpoint_version import ArrowEndpointVersion
|
|
13
|
+
from graphdatascience.arrow_client.arrow_table_utils import table_from_pandas
|
|
13
14
|
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient, ConnectionInfo
|
|
14
15
|
from graphdatascience.query_runner.termination_flag import TerminationFlag
|
|
15
16
|
|
|
@@ -504,14 +505,14 @@ class GdsArrowClient:
|
|
|
504
505
|
batch_size: int,
|
|
505
506
|
) -> list[list[pyarrow.RecordBatch]]:
|
|
506
507
|
if isinstance(data, pandas.DataFrame):
|
|
507
|
-
return [
|
|
508
|
+
return [table_from_pandas(data).to_batches(batch_size)]
|
|
508
509
|
|
|
509
510
|
if isinstance(data, pyarrow.Table):
|
|
510
511
|
return [data.to_batches(batch_size)]
|
|
511
512
|
|
|
512
513
|
if isinstance(data, list):
|
|
513
514
|
if all(isinstance(entry, pandas.DataFrame) for entry in data):
|
|
514
|
-
return [
|
|
515
|
+
return [table_from_pandas(entry).to_batches(batch_size) for entry in data]
|
|
515
516
|
|
|
516
517
|
if all(isinstance(entry, pyarrow.RecordBatch) for entry in data):
|
|
517
518
|
return [data]
|
|
@@ -8,7 +8,7 @@ from tenacity import Retrying, retry_if_result
|
|
|
8
8
|
from graphdatascience.arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
9
9
|
from graphdatascience.arrow_client.v2.api_types import JobIdConfig, JobStatus
|
|
10
10
|
from graphdatascience.arrow_client.v2.data_mapper_utils import deserialize_single
|
|
11
|
-
from graphdatascience.
|
|
11
|
+
from graphdatascience.progress.progress_bar import TqdmProgressBar
|
|
12
12
|
from graphdatascience.query_runner.termination_flag import TerminationFlag
|
|
13
13
|
from graphdatascience.retry_utils.retry_utils import job_wait_strategy
|
|
14
14
|
|
|
@@ -2,7 +2,7 @@ from typing import Protocol
|
|
|
2
2
|
|
|
3
3
|
from pandas import DataFrame
|
|
4
4
|
|
|
5
|
-
from graphdatascience.graph
|
|
5
|
+
from graphdatascience.graph import Graph
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class GraphConstructorFunc(Protocol):
|
|
@@ -13,4 +13,4 @@ class GraphConstructorFunc(Protocol):
|
|
|
13
13
|
relationships: DataFrame | list[DataFrame] | None = None,
|
|
14
14
|
concurrency: int | None = None,
|
|
15
15
|
undirected_relationship_types: list[str] | None = None,
|
|
16
|
-
) ->
|
|
16
|
+
) -> Graph: ...
|
|
@@ -5,14 +5,14 @@ import networkx as nx
|
|
|
5
5
|
from pandas import DataFrame
|
|
6
6
|
|
|
7
7
|
from graphdatascience.datasets.graph_constructor_func import GraphConstructorFunc
|
|
8
|
-
from graphdatascience.graph
|
|
8
|
+
from graphdatascience.graph import Graph
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class NXLoader:
|
|
12
12
|
def __init__(self, graph_constructor: GraphConstructorFunc) -> None:
|
|
13
13
|
self._construct = graph_constructor
|
|
14
14
|
|
|
15
|
-
def load(self, nx_G: nx.Graph, graph_name: str, concurrency: int | None = None) ->
|
|
15
|
+
def load(self, nx_G: nx.Graph, graph_name: str, concurrency: int | None = None) -> Graph:
|
|
16
16
|
"""
|
|
17
17
|
Parameters
|
|
18
18
|
----------
|
|
@@ -25,7 +25,7 @@ class NXLoader:
|
|
|
25
25
|
|
|
26
26
|
Returns
|
|
27
27
|
-------
|
|
28
|
-
|
|
28
|
+
Graph
|
|
29
29
|
A handle to the graph.
|
|
30
30
|
"""
|
|
31
31
|
nodes, rels = self._parse(nx_G)
|
|
@@ -10,7 +10,7 @@ import numpy.typing as npt
|
|
|
10
10
|
import pandas as pd
|
|
11
11
|
|
|
12
12
|
from graphdatascience.datasets.graph_constructor_func import GraphConstructorFunc
|
|
13
|
-
from graphdatascience.graph
|
|
13
|
+
from graphdatascience.graph import Graph
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class _HomogeneousOGBGraphBase(TypedDict):
|
|
@@ -194,7 +194,7 @@ class OGBNLoader(OGBLoader):
|
|
|
194
194
|
dataset_root_path: str = "dataset",
|
|
195
195
|
graph_name: str | None = None,
|
|
196
196
|
concurrency: int | None = None,
|
|
197
|
-
) ->
|
|
197
|
+
) -> Graph:
|
|
198
198
|
"""
|
|
199
199
|
Parameters
|
|
200
200
|
----------
|
|
@@ -209,7 +209,7 @@ class OGBNLoader(OGBLoader):
|
|
|
209
209
|
|
|
210
210
|
Returns
|
|
211
211
|
-------
|
|
212
|
-
|
|
212
|
+
Graph
|
|
213
213
|
A handle to the graph.
|
|
214
214
|
"""
|
|
215
215
|
try:
|
|
@@ -326,7 +326,7 @@ class OGBLLoader(OGBLoader):
|
|
|
326
326
|
dataset_root_path: str = "dataset",
|
|
327
327
|
graph_name: str | None = None,
|
|
328
328
|
concurrency: int | None = None,
|
|
329
|
-
) ->
|
|
329
|
+
) -> Graph:
|
|
330
330
|
"""
|
|
331
331
|
Parameters
|
|
332
332
|
----------
|
|
@@ -341,7 +341,7 @@ class OGBLLoader(OGBLoader):
|
|
|
341
341
|
|
|
342
342
|
Returns
|
|
343
343
|
-------
|
|
344
|
-
|
|
344
|
+
Graph
|
|
345
345
|
A handle to the graph.
|
|
346
346
|
"""
|
|
347
347
|
try:
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import pathlib
|
|
2
2
|
from typing import NamedTuple
|
|
3
3
|
|
|
4
|
-
from neo4j import __version__ as neo4j_driver_version
|
|
5
4
|
from pandas import DataFrame, read_parquet
|
|
6
5
|
|
|
7
6
|
|
|
@@ -11,9 +10,6 @@ class GraphResources(NamedTuple):
|
|
|
11
10
|
|
|
12
11
|
|
|
13
12
|
class SimpleDatasetLoader:
|
|
14
|
-
def __init__(self) -> None:
|
|
15
|
-
self._is_neo4j_4_driver = neo4j_driver_version.startswith("4.")
|
|
16
|
-
|
|
17
13
|
@staticmethod
|
|
18
14
|
def _path(package: str, resource: str) -> pathlib.Path:
|
|
19
15
|
from importlib.resources import files
|
|
@@ -25,10 +21,6 @@ class SimpleDatasetLoader:
|
|
|
25
21
|
file = self._path("graphdatascience.resources.cora", "cora_nodes.parquet.gzip")
|
|
26
22
|
nodes = read_parquet(file)
|
|
27
23
|
|
|
28
|
-
if self._is_neo4j_4_driver:
|
|
29
|
-
# features is read as an ndarray which was not supported in neo4j 4
|
|
30
|
-
nodes["features"] = nodes["features"].apply(lambda x: x.tolist())
|
|
31
|
-
|
|
32
24
|
rels = read_parquet(self._path("graphdatascience.resources.cora", "cora_rels.parquet.gzip"))
|
|
33
25
|
return GraphResources([nodes], [rels])
|
|
34
26
|
|
|
@@ -49,9 +41,6 @@ class SimpleDatasetLoader:
|
|
|
49
41
|
for n in nodes:
|
|
50
42
|
resource = self._path(package, f"imdb_{n}.parquet.gzip")
|
|
51
43
|
df = read_parquet(resource)
|
|
52
|
-
if self._is_neo4j_4_driver:
|
|
53
|
-
# features is read as an ndarray which was not supported in neo4j 4
|
|
54
|
-
df["plot_keywords"] = df["plot_keywords"].apply(lambda x: x.tolist())
|
|
55
44
|
node_dfs.append(df)
|
|
56
45
|
|
|
57
46
|
rel_dfs = []
|
|
@@ -2,8 +2,6 @@ import warnings
|
|
|
2
2
|
from functools import wraps
|
|
3
3
|
from typing import Any, Callable, TypeVar, cast
|
|
4
4
|
|
|
5
|
-
from ..caller_base import CallerBase
|
|
6
|
-
|
|
7
5
|
F = TypeVar("F", bound=Callable[..., Any])
|
|
8
6
|
|
|
9
7
|
|
|
@@ -12,7 +10,7 @@ def filter_id_func_deprecation_warning() -> Callable[[F], F]:
|
|
|
12
10
|
wraps(func)
|
|
13
11
|
|
|
14
12
|
@wraps(func)
|
|
15
|
-
def wrapper(self:
|
|
13
|
+
def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
|
|
16
14
|
# GDS uses the numeric id to resolve the node
|
|
17
15
|
warnings.filterwarnings(
|
|
18
16
|
"ignore",
|
|
@@ -38,6 +36,11 @@ def filter_id_func_deprecation_warning() -> Callable[[F], F]:
|
|
|
38
36
|
message=r"warn: feature deprecated without replacement\. id is deprecated and will be removed without a replacement\.",
|
|
39
37
|
)
|
|
40
38
|
|
|
39
|
+
warnings.filterwarnings(
|
|
40
|
+
"ignore",
|
|
41
|
+
message=r".*is deprecated, use `element_id` instead",
|
|
42
|
+
)
|
|
43
|
+
|
|
41
44
|
return func(self, *args, **kwargs)
|
|
42
45
|
|
|
43
46
|
return cast(F, wrapper)
|
|
@@ -4,11 +4,11 @@ from datetime import datetime
|
|
|
4
4
|
from types import TracebackType
|
|
5
5
|
from typing import Any, Type
|
|
6
6
|
|
|
7
|
-
from graphdatascience.graph.
|
|
8
|
-
from graphdatascience.
|
|
7
|
+
from graphdatascience.graph.graph_backend import GraphBackend
|
|
8
|
+
from graphdatascience.graph.graph_info import GraphInfo
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
class
|
|
11
|
+
class Graph:
|
|
12
12
|
"""
|
|
13
13
|
A graph object that represents a graph in the graph catalog.
|
|
14
14
|
It can be passed into algorithm endpoints to compute over the corresponding graph.
|
|
@@ -19,7 +19,7 @@ class GraphV2:
|
|
|
19
19
|
self._name = name
|
|
20
20
|
self._backend = backend
|
|
21
21
|
|
|
22
|
-
def __enter__(self:
|
|
22
|
+
def __enter__(self: Graph) -> Graph:
|
|
23
23
|
return self
|
|
24
24
|
|
|
25
25
|
def __exit__(
|
|
@@ -127,16 +127,16 @@ class GraphV2:
|
|
|
127
127
|
"""
|
|
128
128
|
return self._backend.exists()
|
|
129
129
|
|
|
130
|
-
def drop(self,
|
|
130
|
+
def drop(self, fail_if_missing: bool = True) -> GraphInfo | None:
|
|
131
131
|
"""
|
|
132
132
|
Args:
|
|
133
|
-
|
|
133
|
+
fail_if_missing: whether to fail if the graph does not exist
|
|
134
134
|
|
|
135
135
|
Returns:
|
|
136
136
|
the result of the drop operation
|
|
137
137
|
|
|
138
138
|
"""
|
|
139
|
-
return self._backend.drop(fail_if_missing=
|
|
139
|
+
return self._backend.drop(fail_if_missing=fail_if_missing)
|
|
140
140
|
|
|
141
141
|
def creation_time(self) -> datetime:
|
|
142
142
|
"""
|
|
@@ -2,7 +2,7 @@ from __future__ import annotations
|
|
|
2
2
|
|
|
3
3
|
from abc import ABC, abstractmethod
|
|
4
4
|
|
|
5
|
-
from graphdatascience.
|
|
5
|
+
from graphdatascience.graph.graph_info import GraphInfo, GraphInfoWithDegrees
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class GraphBackend(ABC):
|