From 4387fb35aac1d20e17e61a013bde6d341e475089 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Fri, 9 May 2025 14:17:44 +0200 Subject: [PATCH 1/5] Fix parsing of gds python client --- python-wrapper/tests/gds_helper.py | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/python-wrapper/tests/gds_helper.py b/python-wrapper/tests/gds_helper.py index 73995202..e5fa270d 100644 --- a/python-wrapper/tests/gds_helper.py +++ b/python-wrapper/tests/gds_helper.py @@ -1,4 +1,5 @@ import os +import re from graphdatascience import GraphDataScience from graphdatascience.semantic_version.semantic_version import SemanticVersion @@ -7,7 +8,22 @@ from graphdatascience.session.aura_api_responses import InstanceCreateDetails from graphdatascience.version import __version__ -GDS_VERSION = SemanticVersion.from_string(__version__) + +def parse_version(version: str) -> SemanticVersion: + server_version_match = re.search(r"(\d+\.)?(\d+\.)?(\*|\d+)", version) + if not server_version_match: + raise ValueError(f"{version} is not a valid semantic version") + + groups = [int(g.replace(".", "")) for g in server_version_match.groups() if g] + + major = groups[0] if len(groups) > 0 else 0 + minor = groups[1] if len(groups) > 1 else 0 + patch = groups[2] if len(groups) > 2 else 0 + + return SemanticVersion(major=major, minor=minor, patch=patch) + + +GDS_VERSION = parse_version(__version__) def connect_to_plugin_gds(uri: str) -> GraphDataScience: From 7f0d71feb1f36f1dc69424895615b84d13414174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Fri, 9 May 2025 14:32:15 +0200 Subject: [PATCH 2/5] Fix streamlit example --- examples/streamlit-example.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/streamlit-example.py b/examples/streamlit-example.py index a0c3e491..ab3106cc 100644 --- a/examples/streamlit-example.py +++ b/examples/streamlit-example.py @@ -18,7 +18,12 @@ def create_visualization_graph() -> VisualizationGraph: cora_rels_path = f"{script_dir_path}/datasets/cora/cora_rels.parquet.gzip" nodes_df = read_parquet(cora_nodes_path) + nodes_df = nodes_df.rename(columns={"nodeId": "id"}) + rels_df = read_parquet(cora_rels_path) + rels_df = rels_df.rename( + columns={"sourceNodeId": "source", "targetNodeId": "target"} + ) # Drop the features column since it's not needed for visualization # Also numpy arrays are not supported by the visualization library From 08de3e53b7ef19b46fe72e82a922d173d5a8bb70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Fri, 9 May 2025 14:32:26 +0200 Subject: [PATCH 3/5] Add util to run streamlit scripts --- scripts/run_streamlit_example.sh | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100755 scripts/run_streamlit_example.sh diff --git a/scripts/run_streamlit_example.sh b/scripts/run_streamlit_example.sh new file mode 100755 index 00000000..2c47431d --- /dev/null +++ b/scripts/run_streamlit_example.sh @@ -0,0 +1,7 @@ +GIT_ROOT=$(git rev-parse --show-toplevel) + +set -o errexit +set -o nounset +set -o pipefail + +streamlit run ${GIT_ROOT}/examples/streamlit-example.py From fc5f58b281fcaa6f36852617da8609ff31f12754 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Fri, 9 May 2025 14:32:36 +0200 Subject: [PATCH 4/5] Update python dependencies --- python-wrapper/pyproject.toml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/python-wrapper/pyproject.toml b/python-wrapper/pyproject.toml index c5bb6060..1bfc7de2 100644 --- a/python-wrapper/pyproject.toml +++ b/python-wrapper/pyproject.toml @@ -41,16 +41,16 @@ requires-python = ">=3.9" [project.optional-dependencies] dev = [ - "ruff==0.9.7", + "ruff==0.11.8", "mypy==1.15.0", "pytest==8.3.4", - "selenium==4.28.1", + "selenium==4.32.0", "ipykernel==6.29.5", "palettable==3.3.3", "pytest-mock==3.14.0", "nbconvert==7.16.6", - "streamlit==1.42.0", - "matplotlib==3.9.4", + "streamlit==1.45.0", + "matplotlib==3.10.1", ] docs = [ "sphinx==8.1.3", @@ -62,12 +62,12 @@ pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"] gds = ["graphdatascience>=1, <2"] neo4j = ["neo4j"] notebook = [ - "ipykernel==6.29.5", - "pykernel==0.1.6", + "ipykernel>=6.29.5", + "pykernel>=0.1.6", "neo4j>=5.26.0", "ipywidgets>=8.0.0", - "palettable==3.3.3", - "matplotlib==3.10.0", + "palettable>=3.3.3", + "matplotlib>=3.10.1", "snowflake-snowpark-python==1.26.0", ] From 0a75bc378cf582ec2a2ba4900f23695c85a2719a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florentin=20D=C3=B6rre?= Date: Fri, 9 May 2025 14:38:06 +0200 Subject: [PATCH 5/5] Relax matplotlib dependency to support python 3.9 --- python-wrapper/pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python-wrapper/pyproject.toml b/python-wrapper/pyproject.toml index 1bfc7de2..a1d3e035 100644 --- a/python-wrapper/pyproject.toml +++ b/python-wrapper/pyproject.toml @@ -50,7 +50,7 @@ dev = [ "pytest-mock==3.14.0", "nbconvert==7.16.6", "streamlit==1.45.0", - "matplotlib==3.10.1", + "matplotlib>=3.9.4", ] docs = [ "sphinx==8.1.3", @@ -67,7 +67,7 @@ notebook = [ "neo4j>=5.26.0", "ipywidgets>=8.0.0", "palettable>=3.3.3", - "matplotlib>=3.10.1", + "matplotlib>=3.9.4", "snowflake-snowpark-python==1.26.0", ]