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
2 changes: 1 addition & 1 deletion .github/workflows/code-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
python-version: "3.11"
enable-cache: true
- run: uv venv
- run: uv pip install ".[dev, pandas, gds, snowflake]"
- run: uv sync --group dev --extra pandas --extra gds --extra snowflake

- name: Check code style
run: source .venv/bin/activate && cd ${GITHUB_WORKSPACE} && ./scripts/checkstyle.sh
2 changes: 1 addition & 1 deletion .github/workflows/gds-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
with:
python-version: "3.11"
enable-cache: true
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Run tests
env:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/render-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ jobs:
with:
python-version: "3.11"
enable-cache: true
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake --extra docs
- run: uv sync --group dev --group docs --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Setup pandoc
uses: pandoc/actions/setup@v1
with:
version: 3.6.2

- name: Render ref docs
run: uv run bash ../scripts/render_docs.sh
run: uv run bash ../scripts/render_api_docs.sh
2 changes: 1 addition & 1 deletion .github/workflows/snowflake-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
with:
python-version: "3.11"
enable-cache: true
- run: uv sync --extra dev --extra pandas --extra snowflake
- run: uv sync --group dev --extra pandas --extra snowflake

- name: Run tests
env:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
enable-cache: true
- run: uv sync --extra dev --extra pandas --extra neo4j --extra gds --extra snowflake
- run: uv sync --group dev --extra pandas --extra neo4j --extra gds --extra snowflake

- name: Run tests
run: uv run pytest tests/
2 changes: 1 addition & 1 deletion docs/antora/modules/ROOT/pages/integration/gds.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,4 @@ VG = from_gds(
VG.color_nodes(property="componentId")
----

See the link:/tutorials/gds-example[Visualizing Neo4j Graph Data Science (GDS) Graphs tutorial] for a more extensive example.
See the link:{tutorials-docs-uri}/gds-example[Visualizing Neo4j Graph Data Science (GDS) Graphs tutorial] for a more extensive example.
2 changes: 1 addition & 1 deletion docs/antora/modules/ROOT/pages/integration/neo4j.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,4 @@ with GraphDatabase.driver(URI, auth=auth) as driver:
VG = from_neo4j(result)
----

See the link:/tutorials/neo4j-example[Visualizing Neo4j Graphs tutorial] for a more extensive example.
See the link:{tutorials-docs-uri}/neo4j-example[Visualizing Neo4j Graphs tutorial] for a more extensive example.
2 changes: 1 addition & 1 deletion docs/antora/modules/ROOT/pages/integration/snowflake.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ VG = from_snowflake(
)
----

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].
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🙈

For a full example of the `from_snowflake` importer in action, please see the link:{tutorials-docs-uri}/snowflake-example/[Visualizing Snowflake Tables tutorial].
11 changes: 7 additions & 4 deletions python-wrapper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ requires-python = ">=3.10"


[project.optional-dependencies]
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
gds = ["graphdatascience>=1, <2"]
neo4j = ["neo4j"]
snowflake = ["snowflake-snowpark-python>=1, <2"]


[dependency-groups]
dev = [
"ruff==0.14.1",
"mypy==1.18.2",
Expand All @@ -57,10 +64,6 @@ docs = [
"nbsphinx==0.9.7",
"nbsphinx-link==1.3.1",
]
pandas = ["pandas>=2, <3", "pandas-stubs>=2, <3"]
gds = ["graphdatascience>=1, <2"]
neo4j = ["neo4j"]
snowflake = ["snowflake-snowpark-python>=1, <2"]
notebook = [
"ipykernel>=6.29.5",
"pykernel>=0.1.6",
Expand Down
6 changes: 6 additions & 0 deletions python-wrapper/src/neo4j_viz/pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ def _parse_nodes(node_dfs: DFS_TYPE, dropna: bool = False) -> list[Node]:
mandatory_fields = {}
properties = {}
for key, value in row.to_dict().items():
if not isinstance(key, str):
key = str(key)

if key in basic_node_fields_aliases:
mandatory_fields[key] = value
else:
Expand Down Expand Up @@ -98,6 +101,9 @@ def _parse_relationships(rel_dfs: DFS_TYPE, dropna: bool = False) -> list[Relati
mandatory_fields = {}
properties = {}
for key, value in row.to_dict().items():
if not isinstance(key, str):
key = str(key)

if key in basic_rel_field_aliases:
mandatory_fields[key] = value
else:
Expand Down
1 change: 0 additions & 1 deletion scripts/makestyle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ if [ "${SKIP_NOTEBOOKS:-false}" == "true" ]; then
fi

python "${GIT_ROOT}/scripts/clean_notebooks.py" -i "${GIT_ROOT}/examples/" -o inplace
python "${GIT_ROOT}/scripts/clean_notebooks.py" -i "${GIT_ROOT}/docs/extra/" -o inplace
9 changes: 9 additions & 0 deletions scripts/render_antora_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -o errexit
set -o nounset
set -o pipefail
set -o xtrace

cd docs/antora
npm install
npm run start
File renamed without changes.
File renamed without changes.