graphdatascience 1.15.1__tar.gz → 1.17a1__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.17a1}/PKG-INFO +3 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/cypher_warning_handler.py +4 -7
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_cypher_runner.py +6 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_entity_ops_runner.py +13 -6
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_object.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph_data_science.py +83 -11
- graphdatascience-1.17a1/graphdatascience/procedure_surface/arrow/wcc_arrow_endpoints.py +191 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/arrow_query_runner.py +28 -12
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/cypher_graph_constructor.py +9 -5
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/gds_arrow_client.py +41 -17
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/neo4j_query_runner.py +104 -26
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/protocol/project_protocols.py +21 -5
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/protocol/write_protocols.py +16 -10
- graphdatascience-1.17a1/graphdatascience/query_runner/query_mode.py +24 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/query_runner.py +17 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/session_query_runner.py +25 -6
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/standalone_session_query_runner.py +18 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/retry_utils/retry_utils.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/aura_api.py +10 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/aura_graph_data_science.py +16 -9
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/dbms/protocol_resolver.py +4 -2
- graphdatascience-1.17a1/graphdatascience/session/dbms_connection_info.py +57 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/dedicated_sessions.py +12 -4
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/gds_sessions.py +28 -3
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/session_info.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/session_sizes.py +1 -0
- graphdatascience-1.17a1/graphdatascience/topological_lp/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/topological_lp/topological_lp_alpha_runner.py +2 -2
- graphdatascience-1.17a1/graphdatascience/utils/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/utils/direct_util_endpoints.py +4 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/utils/util_proc_runner.py +2 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/utils/util_remote_proc_runner.py +4 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/version.py +1 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1/graphdatascience.egg-info}/PKG-INFO +3 -2
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience.egg-info/SOURCES.txt +4 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience.egg-info/requires.txt +2 -1
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/requirements/base/base.txt +2 -1
- graphdatascience-1.15.1/graphdatascience/session/dbms_connection_info.py +0 -25
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/LICENSE +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/MANIFEST.in +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/README.md +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/algo/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/algo/algo_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/algo/algo_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/algo/single_mode_algo_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/call_builder.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/call_parameters.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/caller_base.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/client_only_endpoint.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/endpoint_suggester.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/gds_not_installed.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/illegal_attr_checker.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/unable_to_connect.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/error/uncallable_namespace.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/base_graph_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_create_result.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_export_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_project_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_remote_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_remote_project_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_sample_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/graph_type_check.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/nx_loader.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/graph/ogb_loader.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/ignored_server_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/graphsage_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/link_prediction_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/model_resolver.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/node_classification_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/node_regression_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/pipeline_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/model/simple_rel_embedding_model.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/classification_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/lp_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/lp_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/nc_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/nc_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/nr_pipeline_create_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/nr_training_pipeline.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/pipeline_alpha_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/pipeline_beta_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/pipeline_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/pipeline_proc_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/pipeline/training_pipeline.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner → graphdatascience-1.17a1/graphdatascience/procedure_surface}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner/progress → graphdatascience-1.17a1/graphdatascience/procedure_surface/arrow}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/py.typed +0 -0
- {graphdatascience-1.15.1/graphdatascience/query_runner/protocol → graphdatascience-1.17a1/graphdatascience/query_runner}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/arrow_authentication.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/arrow_endpoint_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/arrow_graph_constructor.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/arrow_info.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/graph_constructor.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources → graphdatascience-1.17a1/graphdatascience/query_runner/progress}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/progress/progress_provider.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/progress/query_progress_logger.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/progress/query_progress_provider.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/progress/static_progress_provider.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/cora → graphdatascience-1.17a1/graphdatascience/query_runner/protocol}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/protocol/status.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/query_runner/termination_flag.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/imdb → graphdatascience-1.17a1/graphdatascience/resources}/__init__.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/karate → graphdatascience-1.17a1/graphdatascience/resources/cora}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/cora/cora_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/cora/cora_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/cora/serialize_cora.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/resources/lastfm → graphdatascience-1.17a1/graphdatascience/resources/imdb}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_acted_in.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_actors.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_directed_in.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_directors.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_movies_with_genre.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/imdb_movies_without_genre.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/imdb/serialize_imdb.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/retry_utils → graphdatascience-1.17a1/graphdatascience/resources/karate}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/karate/karate_club.parquet.gzip +0 -0
- {graphdatascience-1.15.1/graphdatascience/semantic_version → graphdatascience-1.17a1/graphdatascience/resources/lastfm}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/artist_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/serialize_lastfm.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/user_friend_df_directed.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/user_listen_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/user_nodes.parquet.gzip +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/resources/lastfm/user_tag_artist_rels.parquet.gzip +0 -0
- {graphdatascience-1.15.1/graphdatascience/server_version → graphdatascience-1.17a1/graphdatascience/retry_utils}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/retry_utils/retry_config.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/session/dbms → graphdatascience-1.17a1/graphdatascience/semantic_version}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/semantic_version/semantic_version.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/system → graphdatascience-1.17a1/graphdatascience/server_version}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/server_version/compatible_with.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/server_version/server_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/algorithm_category.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/aura_api_responses.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/aura_api_token_authentication.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/aurads_sessions.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/cloud_location.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/topological_lp → graphdatascience-1.17a1/graphdatascience/session/dbms}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/dbms/protocol_version.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/session/region_suggester.py +0 -0
- {graphdatascience-1.15.1/graphdatascience/utils → graphdatascience-1.17a1/graphdatascience/system}/__init__.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/system/config_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/system/system_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/topological_lp/topological_lp_endpoints.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience/utils/util_node_property_func_runner.py +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience.egg-info/dependency_links.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience.egg-info/not-zip-safe +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/graphdatascience.egg-info/top_level.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/pyproject.toml +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/requirements/base/networkx.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/requirements/base/ogb.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/requirements/base/rust-ext.txt +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/setup.cfg +0 -0
- {graphdatascience-1.15.1 → graphdatascience-1.17a1}/setup.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: graphdatascience
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.17a1
|
|
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
|
{graphdatascience-1.15.1 → graphdatascience-1.17a1}/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.17a1}/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.
|
|
@@ -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
|
|
@@ -4,10 +4,12 @@ import warnings
|
|
|
4
4
|
from types import TracebackType
|
|
5
5
|
from typing import Any, Optional, Type, Union
|
|
6
6
|
|
|
7
|
+
import neo4j
|
|
7
8
|
from neo4j import Driver
|
|
8
9
|
from pandas import DataFrame
|
|
9
10
|
|
|
10
11
|
from graphdatascience.query_runner.arrow_authentication import UsernamePasswordAuthentication
|
|
12
|
+
from graphdatascience.query_runner.query_mode import QueryMode
|
|
11
13
|
|
|
12
14
|
from .call_builder import IndirectCallBuilder
|
|
13
15
|
from .endpoints import AlphaEndpoints, BetaEndpoints, DirectEndpoints
|
|
@@ -40,6 +42,7 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
40
42
|
arrow_tls_root_certs: Optional[bytes] = None,
|
|
41
43
|
bookmarks: Optional[Any] = None,
|
|
42
44
|
show_progress: bool = True,
|
|
45
|
+
arrow_client_options: Optional[dict[str, Any]] = None,
|
|
43
46
|
):
|
|
44
47
|
"""
|
|
45
48
|
Construct a new GraphDataScience object.
|
|
@@ -63,14 +66,22 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
63
66
|
- True will make the client discover the connection URI to the GDS Arrow server via the Neo4j endpoint.
|
|
64
67
|
- False will make the client use Bolt for all operations.
|
|
65
68
|
arrow_disable_server_verification : bool, default True
|
|
69
|
+
.. deprecated:: 1.16
|
|
70
|
+
Use arrow_client_options instead
|
|
71
|
+
|
|
66
72
|
A flag that overrides other TLS settings and disables server verification for TLS connections.
|
|
67
73
|
arrow_tls_root_certs : Optional[bytes], default None
|
|
74
|
+
.. deprecated:: 1.16
|
|
75
|
+
Use arrow_client_options instead
|
|
76
|
+
|
|
68
77
|
PEM-encoded certificates that are used for the connection to the
|
|
69
78
|
GDS Arrow Flight server.
|
|
70
79
|
bookmarks : Optional[Any], default None
|
|
71
80
|
The Neo4j bookmarks to require a certain state before the next query gets executed.
|
|
72
81
|
show_progress : bool, default True
|
|
73
82
|
A flag to indicate whether to show progress bars for running procedures.
|
|
83
|
+
arrow_client_options : Optional[dict[str, Any]], default None
|
|
84
|
+
Additional options to be passed to the Arrow Flight client.
|
|
74
85
|
"""
|
|
75
86
|
if aura_ds:
|
|
76
87
|
GraphDataScience._validate_endpoint(endpoint)
|
|
@@ -78,8 +89,11 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
78
89
|
if isinstance(endpoint, QueryRunner):
|
|
79
90
|
self._query_runner = endpoint
|
|
80
91
|
else:
|
|
92
|
+
db_auth = None
|
|
93
|
+
if auth:
|
|
94
|
+
db_auth = neo4j.basic_auth(*auth)
|
|
81
95
|
self._query_runner = Neo4jQueryRunner.create_for_db(
|
|
82
|
-
endpoint,
|
|
96
|
+
endpoint, db_auth, aura_ds, database, bookmarks, show_progress
|
|
83
97
|
)
|
|
84
98
|
|
|
85
99
|
self._server_version = self._query_runner.server_version()
|
|
@@ -100,14 +114,19 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
100
114
|
username, password = auth
|
|
101
115
|
arrow_auth = UsernamePasswordAuthentication(username, password)
|
|
102
116
|
|
|
117
|
+
if arrow_client_options is None:
|
|
118
|
+
arrow_client_options = {}
|
|
119
|
+
if arrow_disable_server_verification:
|
|
120
|
+
arrow_client_options["disable_server_verification"] = True
|
|
121
|
+
if arrow_tls_root_certs is not None:
|
|
122
|
+
arrow_client_options["tls_root_certs"] = arrow_tls_root_certs
|
|
103
123
|
self._query_runner = ArrowQueryRunner.create(
|
|
104
124
|
self._query_runner,
|
|
105
|
-
arrow_info,
|
|
106
|
-
arrow_auth,
|
|
107
|
-
self._query_runner.encrypted(),
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
None if arrow is True else arrow,
|
|
125
|
+
arrow_info=arrow_info,
|
|
126
|
+
arrow_authentication=arrow_auth,
|
|
127
|
+
encrypted=self._query_runner.encrypted(),
|
|
128
|
+
arrow_client_options=arrow_client_options,
|
|
129
|
+
connection_string_override=None if arrow is True else arrow,
|
|
111
130
|
)
|
|
112
131
|
|
|
113
132
|
self._query_runner.set_show_progress(show_progress)
|
|
@@ -195,7 +214,12 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
195
214
|
return self._query_runner.last_bookmarks()
|
|
196
215
|
|
|
197
216
|
def run_cypher(
|
|
198
|
-
self,
|
|
217
|
+
self,
|
|
218
|
+
query: str,
|
|
219
|
+
params: Optional[dict[str, Any]] = None,
|
|
220
|
+
database: Optional[str] = None,
|
|
221
|
+
retryable: bool = False,
|
|
222
|
+
mode: QueryMode = QueryMode.WRITE,
|
|
199
223
|
) -> DataFrame:
|
|
200
224
|
"""
|
|
201
225
|
Run a Cypher query
|
|
@@ -208,6 +232,10 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
208
232
|
parameters to the query
|
|
209
233
|
database: str
|
|
210
234
|
the database on which to run the query
|
|
235
|
+
retryable: bool
|
|
236
|
+
whether the query can be automatically retried. Make sure the query is idempotent if set to True.
|
|
237
|
+
mode: QueryMode
|
|
238
|
+
the query mode to use (READ or WRITE). Set based on the operation performed in the query.
|
|
211
239
|
|
|
212
240
|
Returns:
|
|
213
241
|
The query result as a DataFrame
|
|
@@ -218,7 +246,10 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
218
246
|
if isinstance(self._query_runner, ArrowQueryRunner):
|
|
219
247
|
qr = self._query_runner.fallback_query_runner()
|
|
220
248
|
|
|
221
|
-
|
|
249
|
+
if retryable:
|
|
250
|
+
return qr.run_retryable_cypher(query, params, database, custom_error=False, mode=mode)
|
|
251
|
+
else:
|
|
252
|
+
return qr.run_cypher(query, params, database, custom_error=False, mode=mode)
|
|
222
253
|
|
|
223
254
|
def driver_config(self) -> dict[str, Any]:
|
|
224
255
|
"""
|
|
@@ -235,11 +266,51 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
235
266
|
driver: Driver,
|
|
236
267
|
auth: Optional[tuple[str, str]] = None,
|
|
237
268
|
database: Optional[str] = None,
|
|
238
|
-
arrow: bool = True,
|
|
269
|
+
arrow: Union[str, bool] = True,
|
|
239
270
|
arrow_disable_server_verification: bool = True,
|
|
240
271
|
arrow_tls_root_certs: Optional[bytes] = None,
|
|
241
272
|
bookmarks: Optional[Any] = None,
|
|
242
|
-
|
|
273
|
+
arrow_client_options: Optional[dict[str, Any]] = None,
|
|
274
|
+
) -> GraphDataScience:
|
|
275
|
+
"""
|
|
276
|
+
Construct a new GraphDataScience object from an existing Neo4j Driver.
|
|
277
|
+
This method is useful when you already have a Neo4j Driver instance and want to use it with the GDS client.
|
|
278
|
+
|
|
279
|
+
Parameters
|
|
280
|
+
----------
|
|
281
|
+
driver: Driver
|
|
282
|
+
The Neo4j Driver instance to use.
|
|
283
|
+
auth : Optional[Tuple[str, str]], default None
|
|
284
|
+
A username, password pair for authentication.
|
|
285
|
+
database: Optional[str], default None
|
|
286
|
+
The Neo4j database to query against.
|
|
287
|
+
arrow : Union[str, bool], default True
|
|
288
|
+
Arrow connection information. This is either a string or a bool.
|
|
289
|
+
|
|
290
|
+
- If it is a string, it will be interpreted as a connection URL to a GDS Arrow Server.
|
|
291
|
+
- If it is a bool:
|
|
292
|
+
- True will make the client discover the connection URI to the GDS Arrow server via the Neo4j endpoint.
|
|
293
|
+
- False will make the client use Bolt for all operations.
|
|
294
|
+
arrow_disable_server_verification : bool, default True
|
|
295
|
+
.. deprecated:: 1.16
|
|
296
|
+
Use arrow_client_options instead
|
|
297
|
+
|
|
298
|
+
A flag that overrides other TLS settings and disables server verification for TLS connections.
|
|
299
|
+
arrow_tls_root_certs : Optional[bytes], default None
|
|
300
|
+
.. deprecated:: 1.16
|
|
301
|
+
Use arrow_client_options instead
|
|
302
|
+
|
|
303
|
+
PEM-encoded certificates that are used for the connection to the
|
|
304
|
+
GDS Arrow Flight server.
|
|
305
|
+
bookmarks : Optional[Any], default None
|
|
306
|
+
The Neo4j bookmarks to require a certain state before the next query gets executed.
|
|
307
|
+
show_progress : bool, default True
|
|
308
|
+
A flag to indicate whether to show progress bars for running procedures.
|
|
309
|
+
arrow_client_options : Optional[dict[str, Any]], default None
|
|
310
|
+
Additional options to be passed to the Arrow Flight client.
|
|
311
|
+
Returns:
|
|
312
|
+
A new GraphDataScience object. configured with the provided Neo4j Driver.
|
|
313
|
+
"""
|
|
243
314
|
return cls(
|
|
244
315
|
driver,
|
|
245
316
|
auth=auth,
|
|
@@ -248,6 +319,7 @@ class GraphDataScience(DirectEndpoints, UncallableNamespace):
|
|
|
248
319
|
arrow_disable_server_verification=arrow_disable_server_verification,
|
|
249
320
|
arrow_tls_root_certs=arrow_tls_root_certs,
|
|
250
321
|
bookmarks=bookmarks,
|
|
322
|
+
arrow_client_options=arrow_client_options,
|
|
251
323
|
)
|
|
252
324
|
|
|
253
325
|
@staticmethod
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import json
|
|
2
|
+
from typing import Any, List, Optional
|
|
3
|
+
|
|
4
|
+
from pandas import DataFrame
|
|
5
|
+
|
|
6
|
+
from ...arrow_client.authenticated_flight_client import AuthenticatedArrowClient
|
|
7
|
+
from ...arrow_client.v2.data_mapper_utils import deserialize_single
|
|
8
|
+
from ...arrow_client.v2.job_client import JobClient
|
|
9
|
+
from ...arrow_client.v2.mutation_client import MutationClient
|
|
10
|
+
from ...arrow_client.v2.write_back_client import WriteBackClient
|
|
11
|
+
from ...graph.graph_object import Graph
|
|
12
|
+
from ..api.estimation_result import EstimationResult
|
|
13
|
+
from ..api.wcc_endpoints import WccEndpoints, WccMutateResult, WccStatsResult, WccWriteResult
|
|
14
|
+
from ..utils.config_converter import ConfigConverter
|
|
15
|
+
|
|
16
|
+
WCC_ENDPOINT = "v2/community.wcc"
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
class WccArrowEndpoints(WccEndpoints):
|
|
20
|
+
def __init__(self, arrow_client: AuthenticatedArrowClient, write_back_client: Optional[WriteBackClient] = None):
|
|
21
|
+
self._arrow_client = arrow_client
|
|
22
|
+
self._write_back_client = write_back_client
|
|
23
|
+
|
|
24
|
+
def mutate(
|
|
25
|
+
self,
|
|
26
|
+
G: Graph,
|
|
27
|
+
mutate_property: str,
|
|
28
|
+
threshold: Optional[float] = None,
|
|
29
|
+
relationship_types: Optional[List[str]] = None,
|
|
30
|
+
node_labels: Optional[List[str]] = None,
|
|
31
|
+
sudo: Optional[bool] = None,
|
|
32
|
+
log_progress: Optional[bool] = None,
|
|
33
|
+
username: Optional[str] = None,
|
|
34
|
+
concurrency: Optional[int] = None,
|
|
35
|
+
job_id: Optional[str] = None,
|
|
36
|
+
seed_property: Optional[str] = None,
|
|
37
|
+
consecutive_ids: Optional[bool] = None,
|
|
38
|
+
relationship_weight_property: Optional[str] = None,
|
|
39
|
+
) -> WccMutateResult:
|
|
40
|
+
config = ConfigConverter.convert_to_gds_config(
|
|
41
|
+
graph_name=G.name(),
|
|
42
|
+
concurrency=concurrency,
|
|
43
|
+
consecutive_ids=consecutive_ids,
|
|
44
|
+
job_id=job_id,
|
|
45
|
+
log_progress=log_progress,
|
|
46
|
+
node_labels=node_labels,
|
|
47
|
+
relationship_types=relationship_types,
|
|
48
|
+
relationship_weight_property=relationship_weight_property,
|
|
49
|
+
seed_property=seed_property,
|
|
50
|
+
sudo=sudo,
|
|
51
|
+
threshold=threshold,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
job_id = JobClient.run_job_and_wait(self._arrow_client, WCC_ENDPOINT, config)
|
|
55
|
+
|
|
56
|
+
mutate_result = MutationClient.mutate_node_property(self._arrow_client, job_id, mutate_property)
|
|
57
|
+
computation_result = JobClient.get_summary(self._arrow_client, job_id)
|
|
58
|
+
|
|
59
|
+
computation_result["nodePropertiesWritten"] = mutate_result.node_properties_written
|
|
60
|
+
computation_result["mutateMillis"] = 0
|
|
61
|
+
|
|
62
|
+
return WccMutateResult(**computation_result)
|
|
63
|
+
|
|
64
|
+
def stats(
|
|
65
|
+
self,
|
|
66
|
+
G: Graph,
|
|
67
|
+
threshold: Optional[float] = None,
|
|
68
|
+
relationship_types: Optional[List[str]] = None,
|
|
69
|
+
node_labels: Optional[List[str]] = None,
|
|
70
|
+
sudo: Optional[bool] = None,
|
|
71
|
+
log_progress: Optional[bool] = None,
|
|
72
|
+
username: Optional[str] = None,
|
|
73
|
+
concurrency: Optional[int] = None,
|
|
74
|
+
job_id: Optional[str] = None,
|
|
75
|
+
seed_property: Optional[str] = None,
|
|
76
|
+
consecutive_ids: Optional[bool] = None,
|
|
77
|
+
relationship_weight_property: Optional[str] = None,
|
|
78
|
+
) -> WccStatsResult:
|
|
79
|
+
config = ConfigConverter.convert_to_gds_config(
|
|
80
|
+
graph_name=G.name(),
|
|
81
|
+
concurrency=concurrency,
|
|
82
|
+
consecutive_ids=consecutive_ids,
|
|
83
|
+
job_id=job_id,
|
|
84
|
+
log_progress=log_progress,
|
|
85
|
+
node_labels=node_labels,
|
|
86
|
+
relationship_types=relationship_types,
|
|
87
|
+
relationship_weight_property=relationship_weight_property,
|
|
88
|
+
seed_property=seed_property,
|
|
89
|
+
sudo=sudo,
|
|
90
|
+
threshold=threshold,
|
|
91
|
+
)
|
|
92
|
+
|
|
93
|
+
job_id = JobClient.run_job_and_wait(self._arrow_client, WCC_ENDPOINT, config)
|
|
94
|
+
computation_result = JobClient.get_summary(self._arrow_client, job_id)
|
|
95
|
+
|
|
96
|
+
return WccStatsResult(**computation_result)
|
|
97
|
+
|
|
98
|
+
def stream(
|
|
99
|
+
self,
|
|
100
|
+
G: Graph,
|
|
101
|
+
min_component_size: Optional[int] = None,
|
|
102
|
+
threshold: Optional[float] = None,
|
|
103
|
+
relationship_types: Optional[List[str]] = None,
|
|
104
|
+
node_labels: Optional[List[str]] = None,
|
|
105
|
+
sudo: Optional[bool] = None,
|
|
106
|
+
log_progress: Optional[bool] = None,
|
|
107
|
+
username: Optional[str] = None,
|
|
108
|
+
concurrency: Optional[int] = None,
|
|
109
|
+
job_id: Optional[str] = None,
|
|
110
|
+
seed_property: Optional[str] = None,
|
|
111
|
+
consecutive_ids: Optional[bool] = None,
|
|
112
|
+
relationship_weight_property: Optional[str] = None,
|
|
113
|
+
) -> DataFrame:
|
|
114
|
+
config = ConfigConverter.convert_to_gds_config(
|
|
115
|
+
graph_name=G.name(),
|
|
116
|
+
concurrency=concurrency,
|
|
117
|
+
consecutive_ids=consecutive_ids,
|
|
118
|
+
job_id=job_id,
|
|
119
|
+
log_progress=log_progress,
|
|
120
|
+
min_component_size=min_component_size,
|
|
121
|
+
node_labels=node_labels,
|
|
122
|
+
relationship_types=relationship_types,
|
|
123
|
+
relationship_weight_property=relationship_weight_property,
|
|
124
|
+
seed_property=seed_property,
|
|
125
|
+
sudo=sudo,
|
|
126
|
+
threshold=threshold,
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
job_id = JobClient.run_job_and_wait(self._arrow_client, WCC_ENDPOINT, config)
|
|
130
|
+
return JobClient.stream_results(self._arrow_client, G.name(), job_id)
|
|
131
|
+
|
|
132
|
+
def write(
|
|
133
|
+
self,
|
|
134
|
+
G: Graph,
|
|
135
|
+
write_property: str,
|
|
136
|
+
min_component_size: Optional[int] = None,
|
|
137
|
+
threshold: Optional[float] = None,
|
|
138
|
+
relationship_types: Optional[List[str]] = None,
|
|
139
|
+
node_labels: Optional[List[str]] = None,
|
|
140
|
+
sudo: Optional[bool] = None,
|
|
141
|
+
log_progress: Optional[bool] = None,
|
|
142
|
+
username: Optional[str] = None,
|
|
143
|
+
concurrency: Optional[int] = None,
|
|
144
|
+
job_id: Optional[str] = None,
|
|
145
|
+
seed_property: Optional[str] = None,
|
|
146
|
+
consecutive_ids: Optional[bool] = None,
|
|
147
|
+
relationship_weight_property: Optional[str] = None,
|
|
148
|
+
write_concurrency: Optional[int] = None,
|
|
149
|
+
) -> WccWriteResult:
|
|
150
|
+
config = ConfigConverter.convert_to_gds_config(
|
|
151
|
+
graph_name=G.name(),
|
|
152
|
+
concurrency=concurrency,
|
|
153
|
+
consecutive_ids=consecutive_ids,
|
|
154
|
+
job_id=job_id,
|
|
155
|
+
log_progress=log_progress,
|
|
156
|
+
min_component_size=min_component_size,
|
|
157
|
+
node_labels=node_labels,
|
|
158
|
+
relationship_types=relationship_types,
|
|
159
|
+
relationship_weight_property=relationship_weight_property,
|
|
160
|
+
seed_property=seed_property,
|
|
161
|
+
sudo=sudo,
|
|
162
|
+
threshold=threshold,
|
|
163
|
+
)
|
|
164
|
+
|
|
165
|
+
job_id = JobClient.run_job_and_wait(self._arrow_client, WCC_ENDPOINT, config)
|
|
166
|
+
computation_result = JobClient.get_summary(self._arrow_client, job_id)
|
|
167
|
+
|
|
168
|
+
if self._write_back_client is None:
|
|
169
|
+
raise Exception("Write back client is not initialized")
|
|
170
|
+
|
|
171
|
+
write_millis = self._write_back_client.write(
|
|
172
|
+
G.name(), job_id, write_concurrency if write_concurrency is not None else concurrency
|
|
173
|
+
)
|
|
174
|
+
|
|
175
|
+
computation_result["writeMillis"] = write_millis
|
|
176
|
+
|
|
177
|
+
return WccWriteResult(**computation_result)
|
|
178
|
+
|
|
179
|
+
def estimate(
|
|
180
|
+
self, G: Optional[Graph] = None, projection_config: Optional[dict[str, Any]] = None
|
|
181
|
+
) -> EstimationResult:
|
|
182
|
+
if G is not None:
|
|
183
|
+
payload = {"graphName": G.name()}
|
|
184
|
+
elif projection_config is not None:
|
|
185
|
+
payload = projection_config
|
|
186
|
+
else:
|
|
187
|
+
raise ValueError("Either graph_name or projection_config must be provided.")
|
|
188
|
+
|
|
189
|
+
res = self._arrow_client.do_action_with_retry("v2/community.wcc.estimate", json.dumps(payload).encode("utf-8"))
|
|
190
|
+
|
|
191
|
+
return EstimationResult(**deserialize_single(res))
|
|
@@ -6,6 +6,7 @@ from typing import Any, Optional
|
|
|
6
6
|
from pandas import DataFrame
|
|
7
7
|
|
|
8
8
|
from graphdatascience.query_runner.arrow_authentication import ArrowAuthentication
|
|
9
|
+
from graphdatascience.query_runner.query_mode import QueryMode
|
|
9
10
|
from graphdatascience.retry_utils.retry_config import RetryConfig
|
|
10
11
|
|
|
11
12
|
from ..call_parameters import CallParameters
|
|
@@ -24,8 +25,7 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
24
25
|
arrow_info: ArrowInfo,
|
|
25
26
|
arrow_authentication: Optional[ArrowAuthentication] = None,
|
|
26
27
|
encrypted: bool = False,
|
|
27
|
-
|
|
28
|
-
tls_root_certs: Optional[bytes] = None,
|
|
28
|
+
arrow_client_options: Optional[dict[str, Any]] = None,
|
|
29
29
|
connection_string_override: Optional[str] = None,
|
|
30
30
|
retry_config: Optional[RetryConfig] = None,
|
|
31
31
|
) -> ArrowQueryRunner:
|
|
@@ -33,13 +33,12 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
33
33
|
raise ValueError("Arrow is not enabled on the server")
|
|
34
34
|
|
|
35
35
|
gds_arrow_client = GdsArrowClient.create(
|
|
36
|
-
arrow_info,
|
|
37
|
-
arrow_authentication,
|
|
38
|
-
encrypted,
|
|
39
|
-
|
|
40
|
-
tls_root_certs,
|
|
41
|
-
connection_string_override,
|
|
36
|
+
arrow_info=arrow_info,
|
|
37
|
+
auth=arrow_authentication,
|
|
38
|
+
encrypted=encrypted,
|
|
39
|
+
connection_string_override=connection_string_override,
|
|
42
40
|
retry_config=retry_config,
|
|
41
|
+
arrow_client_options=arrow_client_options,
|
|
43
42
|
)
|
|
44
43
|
|
|
45
44
|
return ArrowQueryRunner(gds_arrow_client, fallback_query_runner, fallback_query_runner.server_version())
|
|
@@ -64,9 +63,22 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
64
63
|
query: str,
|
|
65
64
|
params: Optional[dict[str, Any]] = None,
|
|
66
65
|
database: Optional[str] = None,
|
|
66
|
+
mode: Optional[QueryMode] = None,
|
|
67
67
|
custom_error: bool = True,
|
|
68
68
|
) -> DataFrame:
|
|
69
|
-
return self._fallback_query_runner.run_cypher(query, params, database, custom_error)
|
|
69
|
+
return self._fallback_query_runner.run_cypher(query, params, database, mode, custom_error=custom_error)
|
|
70
|
+
|
|
71
|
+
def run_retryable_cypher(
|
|
72
|
+
self,
|
|
73
|
+
query: str,
|
|
74
|
+
params: Optional[dict[str, Any]] = None,
|
|
75
|
+
database: Optional[str] = None,
|
|
76
|
+
mode: Optional[QueryMode] = None,
|
|
77
|
+
custom_error: bool = True,
|
|
78
|
+
) -> DataFrame:
|
|
79
|
+
return self._fallback_query_runner.run_retryable_cypher(
|
|
80
|
+
query, params, database, mode, custom_error=custom_error
|
|
81
|
+
)
|
|
70
82
|
|
|
71
83
|
def call_function(self, endpoint: str, params: Optional[CallParameters] = None) -> Any:
|
|
72
84
|
return self._fallback_query_runner.call_function(endpoint, params)
|
|
@@ -77,7 +89,9 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
77
89
|
params: Optional[CallParameters] = None,
|
|
78
90
|
yields: Optional[list[str]] = None,
|
|
79
91
|
database: Optional[str] = None,
|
|
92
|
+
mode: QueryMode = QueryMode.READ,
|
|
80
93
|
logging: bool = False,
|
|
94
|
+
retryable: bool = False,
|
|
81
95
|
custom_error: bool = True,
|
|
82
96
|
) -> DataFrame:
|
|
83
97
|
if params is None:
|
|
@@ -171,7 +185,9 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
171
185
|
graph_name, self._database_or_throw(), relationship_types, concurrency
|
|
172
186
|
)
|
|
173
187
|
|
|
174
|
-
return self._fallback_query_runner.call_procedure(
|
|
188
|
+
return self._fallback_query_runner.call_procedure(
|
|
189
|
+
endpoint, params, yields, database, logging=logging, retryable=retryable, custom_error=custom_error
|
|
190
|
+
)
|
|
175
191
|
|
|
176
192
|
def server_version(self) -> ServerVersion:
|
|
177
193
|
return self._fallback_query_runner.server_version()
|
|
@@ -211,10 +227,10 @@ class ArrowQueryRunner(QueryRunner):
|
|
|
211
227
|
self._fallback_query_runner.close()
|
|
212
228
|
self._gds_arrow_client.close()
|
|
213
229
|
|
|
214
|
-
def
|
|
230
|
+
def cloneWithoutRouting(self, host: str, port: int) -> "QueryRunner":
|
|
215
231
|
return ArrowQueryRunner(
|
|
216
232
|
self._gds_arrow_client,
|
|
217
|
-
self._fallback_query_runner.
|
|
233
|
+
self._fallback_query_runner.cloneWithoutRouting(host, port),
|
|
218
234
|
self._server_version,
|
|
219
235
|
)
|
|
220
236
|
|
|
@@ -7,6 +7,8 @@ from uuid import uuid4
|
|
|
7
7
|
|
|
8
8
|
from pandas import DataFrame, concat
|
|
9
9
|
|
|
10
|
+
from graphdatascience.query_runner.query_mode import QueryMode
|
|
11
|
+
|
|
10
12
|
from ..server_version.server_version import ServerVersion
|
|
11
13
|
from .graph_constructor import GraphConstructor
|
|
12
14
|
from .query_runner import QueryRunner
|
|
@@ -104,15 +106,16 @@ class CypherGraphConstructor(GraphConstructor):
|
|
|
104
106
|
|
|
105
107
|
def _should_warn_about_arrow_missing(self) -> bool:
|
|
106
108
|
try:
|
|
107
|
-
license: str = self._query_runner.
|
|
108
|
-
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value",
|
|
109
|
+
license: str = self._query_runner.run_retryable_cypher(
|
|
110
|
+
"CALL gds.debug.sysInfo() YIELD key, value WHERE key = 'gdsEdition' RETURN value",
|
|
111
|
+
custom_error=False,
|
|
112
|
+
mode=QueryMode.READ,
|
|
109
113
|
).squeeze()
|
|
110
114
|
should_warn = license == "Licensed"
|
|
111
115
|
except Exception as e:
|
|
112
116
|
# It's not a user's concern whether Arrow is set up or not in AuraDS.
|
|
113
|
-
if (
|
|
114
|
-
|
|
115
|
-
"registered for this database instance." in str(e)
|
|
117
|
+
if "There is no procedure with the name `gds.debug.sysInfo` registered for this database instance." in str(
|
|
118
|
+
e
|
|
116
119
|
):
|
|
117
120
|
should_warn = False
|
|
118
121
|
else:
|
|
@@ -210,6 +213,7 @@ class CypherGraphConstructor(GraphConstructor):
|
|
|
210
213
|
"undirectedRelationshipTypes": self._undirected_relationship_types,
|
|
211
214
|
}
|
|
212
215
|
|
|
216
|
+
# not using retryable here as gds.graph.project adds a graph to the gds graph catalog
|
|
213
217
|
self._query_runner.run_cypher(
|
|
214
218
|
query,
|
|
215
219
|
{
|