From 21f8ed261acb376676468314eb3aa95275f2f2b9 Mon Sep 17 00:00:00 2001 From: Martin Junghanns Date: Tue, 4 Nov 2025 17:04:15 +0100 Subject: [PATCH 1/2] Drop table property key after caption assignment --- python-wrapper/src/neo4j_viz/snowflake.py | 4 ++-- python-wrapper/tests/test_snowflake.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python-wrapper/src/neo4j_viz/snowflake.py b/python-wrapper/src/neo4j_viz/snowflake.py index 75b43c20..f665c522 100644 --- a/python-wrapper/src/neo4j_viz/snowflake.py +++ b/python-wrapper/src/neo4j_viz/snowflake.py @@ -341,9 +341,9 @@ def from_snowflake( VG = from_dfs(node_dfs, rel_dfs) for node in VG.nodes: - node.caption = node.properties.get("table") + node.caption = node.properties.pop("table") for rel in VG.relationships: - rel.caption = rel.properties.get("table") + rel.caption = rel.properties.pop("table") number_of_colors = node_df["table"].drop_duplicates().count() if number_of_colors <= len(NEO4J_COLORS_DISCRETE): diff --git a/python-wrapper/tests/test_snowflake.py b/python-wrapper/tests/test_snowflake.py index 0cb86ba2..c786b921 100644 --- a/python-wrapper/tests/test_snowflake.py +++ b/python-wrapper/tests/test_snowflake.py @@ -60,8 +60,8 @@ def test_from_snowflake(session_with_minimal_graph: Session) -> None: ) assert VG.nodes == [ - Node(id=0, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 6, "table": "NODES"}), - Node(id=1, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 7, "table": "NODES"}), + Node(id=0, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 6}), + Node(id=1, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 7}), ] assert len(VG.relationships) == 1 @@ -69,4 +69,4 @@ def test_from_snowflake(session_with_minimal_graph: Session) -> None: assert VG.relationships[0].source == 0 assert VG.relationships[0].target == 1 assert VG.relationships[0].caption == "RELS" - assert VG.relationships[0].properties == {"table": "RELS"} + assert VG.relationships[0].properties == {} From fb754182c0d06de85ff176494e506afaaf360f23 Mon Sep 17 00:00:00 2001 From: Martin Junghanns Date: Wed, 5 Nov 2025 10:41:18 +0100 Subject: [PATCH 2/2] Add changelog entry --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index a9233f3d..5d024393 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,7 @@ ## Breaking changes +* Removed `table` property from nodes and relationships returned from `from_snowflake`, the table is represented by the `caption` field. ## New features