Skip to content

Commit 2045005

Browse files
authored
Merge pull request #258 from neo4j/seperate-dependency-groups
Fix tutorial links + move dev deps to dependency groups
2 parents 31ac85b + 2e7a6f7 commit 2045005

File tree

14 files changed

+31
-14
lines changed

14 files changed

+31
-14
lines changed

.github/workflows/code-style.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
python-version: "3.11"
3434
enable-cache: true
3535
- run: uv venv
36-
- run: uv pip install ".[dev, pandas, gds, snowflake]"
36+
- run: uv sync --group dev --extra pandas --extra gds --extra snowflake
3737

3838
- name: Check code style
3939
run: source .venv/bin/activate && cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh

.github/workflows/gds-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
with:
3434
python-version: "3.11"
3535
enable-cache: true
36-
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
36+
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake
3737

3838
- name: Run tests
3939
env:

.github/workflows/render-docs.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ jobs:
3333
with:
3434
python-version: "3.11"
3535
enable-cache: true
36-
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake --extra docs
36+
- run: uv sync --group dev --group docs --extra pandas --extra neo4j --extra gds --extra snowflake
3737

3838
- name: Setup pandoc
3939
uses: pandoc/actions/setup@v1
4040
with:
4141
version: 3.6.2
4242

4343
- name: Render ref docs
44-
run: uv run bash ../scripts/render_docs.sh
44+
run: uv run bash ../scripts/render_api_docs.sh

.github/workflows/snowflake-integration-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
with:
3535
python-version: "3.11"
3636
enable-cache: true
37-
- run: uv sync --extra dev --extra pandas --extra snowflake
37+
- run: uv sync --group dev --extra pandas --extra snowflake
3838

3939
- name: Run tests
4040
env:

.github/workflows/unit-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
with:
3939
python-version: ${{ matrix.python-version }}
4040
enable-cache: true
41-
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
41+
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake
4242

4343
- name: Run tests
4444
run: uv run pytest tests/

docs/antora/modules/ROOT/pages/integration/gds.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,4 +53,4 @@ VG = from_gds(
5353
VG.color_nodes(property="componentId")
5454
----
5555

56-
See the link:/tutorials/gds-example[Visualizing Neo4j Graph Data Science (GDS) Graphs tutorial] for a more extensive example.
56+
See the link:{tutorials-docs-uri}/gds-example[Visualizing Neo4j Graph Data Science (GDS) Graphs tutorial] for a more extensive example.

docs/antora/modules/ROOT/pages/integration/neo4j.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ with GraphDatabase.driver(URI, auth=auth) as driver:
4242
VG = from_neo4j(result)
4343
----
4444

45-
See the link:/tutorials/neo4j-example[Visualizing Neo4j Graphs tutorial] for a more extensive example.
45+
See the link:{tutorials-docs-uri}/neo4j-example[Visualizing Neo4j Graphs tutorial] for a more extensive example.

docs/antora/modules/ROOT/pages/integration/snowflake.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,4 @@ VG = from_snowflake(
8484
)
8585
----
8686

87-
For a full example of the `from_snowflake` importer in action, please see the link:http://localhost:9000/tutorials/snowflake-example/[Visualizing Snowflake Tables tutorial].
87+
For a full example of the `from_snowflake` importer in action, please see the link:{tutorials-docs-uri}/snowflake-example/[Visualizing Snowflake Tables tutorial].

python-wrapper/pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,13 @@ requires-python = ">=3.10"
3939

4040

4141
[project.optional-dependencies]
42+
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
43+
gds = ["graphdatascience>=1, <2"]
44+
neo4j = ["neo4j"]
45+
snowflake = ["snowflake-snowpark-python>=1, <2"]
46+
47+
48+
[dependency-groups]
4249
dev = [
4350
"ruff==0.14.1",
4451
"mypy==1.18.2",
@@ -57,10 +64,6 @@ docs = [
5764
"nbsphinx==0.9.7",
5865
"nbsphinx-link==1.3.1",
5966
]
60-
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
61-
gds = ["graphdatascience>=1, <2"]
62-
neo4j = ["neo4j"]
63-
snowflake = ["snowflake-snowpark-python>=1, <2"]
6467
notebook = [
6568
"ipykernel>=6.29.5",
6669
"pykernel>=0.1.6",

python-wrapper/src/neo4j_viz/pandas.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,9 @@ def _parse_nodes(node_dfs: DFS_TYPE, dropna: bool = False) -> list[Node]:
6969
mandatory_fields = {}
7070
properties = {}
7171
for key, value in row.to_dict().items():
72+
if not isinstance(key, str):
73+
key = str(key)
74+
7275
if key in basic_node_fields_aliases:
7376
mandatory_fields[key] = value
7477
else:
@@ -98,6 +101,9 @@ def _parse_relationships(rel_dfs: DFS_TYPE, dropna: bool = False) -> list[Relati
98101
mandatory_fields = {}
99102
properties = {}
100103
for key, value in row.to_dict().items():
104+
if not isinstance(key, str):
105+
key = str(key)
106+
101107
if key in basic_rel_field_aliases:
102108
mandatory_fields[key] = value
103109
else:

0 commit comments

Comments
 (0)