Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions examples/streamlit-example.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 8 additions & 8 deletions python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
]

Expand Down
18 changes: 17 additions & 1 deletion python-wrapper/tests/gds_helper.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re

from graphdatascience import GraphDataScience
from graphdatascience.semantic_version.semantic_version import SemanticVersion
Expand All @@ -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:
Expand Down
7 changes: 7 additions & 0 deletions scripts/run_streamlit_example.sh
Original file line number Diff line number Diff line change
@@ -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