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 diff --git a/python-wrapper/pyproject.toml b/python-wrapper/pyproject.toml index c5bb6060..a1d3e035 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.9.4", ] 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.9.4", "snowflake-snowpark-python==1.26.0", ] 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: 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