diff --git a/.github/workflows/code-style.yml b/.github/workflows/code-style.yml index 8d4eed4d..50260f89 100644 --- a/.github/workflows/code-style.yml +++ b/.github/workflows/code-style.yml @@ -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 diff --git a/.github/workflows/gds-integration-tests.yml b/.github/workflows/gds-integration-tests.yml index 2f901bf9..21034a7d 100644 --- a/.github/workflows/gds-integration-tests.yml +++ b/.github/workflows/gds-integration-tests.yml @@ -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: diff --git a/.github/workflows/render-docs.yml b/.github/workflows/render-docs.yml index fd9d732b..3415b34d 100644 --- a/.github/workflows/render-docs.yml +++ b/.github/workflows/render-docs.yml @@ -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 --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 @@ -41,4 +41,4 @@ jobs: 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 diff --git a/.github/workflows/snowflake-integration-tests.yml b/.github/workflows/snowflake-integration-tests.yml index b28d6446..71090964 100644 --- a/.github/workflows/snowflake-integration-tests.yml +++ b/.github/workflows/snowflake-integration-tests.yml @@ -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: diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 413ae061..8d7cc821 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -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/ diff --git a/docs/antora/modules/ROOT/pages/integration/gds.adoc b/docs/antora/modules/ROOT/pages/integration/gds.adoc index a61beaef..46e80935 100644 --- a/docs/antora/modules/ROOT/pages/integration/gds.adoc +++ b/docs/antora/modules/ROOT/pages/integration/gds.adoc @@ -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. \ No newline at end of file +See the link:{tutorials-docs-uri}/gds-example[Visualizing Neo4j Graph Data Science (GDS) Graphs tutorial] for a more extensive example. \ No newline at end of file diff --git a/docs/antora/modules/ROOT/pages/integration/neo4j.adoc b/docs/antora/modules/ROOT/pages/integration/neo4j.adoc index baffdd14..9a031f5a 100644 --- a/docs/antora/modules/ROOT/pages/integration/neo4j.adoc +++ b/docs/antora/modules/ROOT/pages/integration/neo4j.adoc @@ -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. \ No newline at end of file +See the link:{tutorials-docs-uri}/neo4j-example[Visualizing Neo4j Graphs tutorial] for a more extensive example. \ No newline at end of file diff --git a/docs/antora/modules/ROOT/pages/integration/snowflake.adoc b/docs/antora/modules/ROOT/pages/integration/snowflake.adoc index f36405fc..d8e9d2f2 100644 --- a/docs/antora/modules/ROOT/pages/integration/snowflake.adoc +++ b/docs/antora/modules/ROOT/pages/integration/snowflake.adoc @@ -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]. \ No newline at end of file +For a full example of the `from_snowflake` importer in action, please see the link:{tutorials-docs-uri}/snowflake-example/[Visualizing Snowflake Tables tutorial]. \ No newline at end of file diff --git a/python-wrapper/pyproject.toml b/python-wrapper/pyproject.toml index e6fcbeab..c2d2d13e 100644 --- a/python-wrapper/pyproject.toml +++ b/python-wrapper/pyproject.toml @@ -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", @@ -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", diff --git a/python-wrapper/src/neo4j_viz/pandas.py b/python-wrapper/src/neo4j_viz/pandas.py index f7f01c08..50d19a9b 100644 --- a/python-wrapper/src/neo4j_viz/pandas.py +++ b/python-wrapper/src/neo4j_viz/pandas.py @@ -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: @@ -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: diff --git a/scripts/makestyle.sh b/scripts/makestyle.sh index 4e8f5b6e..0c4a7571 100755 --- a/scripts/makestyle.sh +++ b/scripts/makestyle.sh @@ -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 diff --git a/scripts/render_antora_docs.sh b/scripts/render_antora_docs.sh new file mode 100755 index 00000000..0b0a3a43 --- /dev/null +++ b/scripts/render_antora_docs.sh @@ -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 \ No newline at end of file diff --git a/scripts/render_docs.sh b/scripts/render_api_docs.sh similarity index 100% rename from scripts/render_docs.sh rename to scripts/render_api_docs.sh diff --git a/scripts/render_and_host_docs.sh b/scripts/render_host_api_docs.sh similarity index 100% rename from scripts/render_and_host_docs.sh rename to scripts/render_host_api_docs.sh