Skip to content

Commit 21f8ed2

Browse files
committed
Drop table property key after caption assignment
1 parent 4352dac commit 21f8ed2

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python-wrapper/src/neo4j_viz/snowflake.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,9 +341,9 @@ def from_snowflake(
341341
VG = from_dfs(node_dfs, rel_dfs)
342342

343343
for node in VG.nodes:
344-
node.caption = node.properties.get("table")
344+
node.caption = node.properties.pop("table")
345345
for rel in VG.relationships:
346-
rel.caption = rel.properties.get("table")
346+
rel.caption = rel.properties.pop("table")
347347

348348
number_of_colors = node_df["table"].drop_duplicates().count()
349349
if number_of_colors <= len(NEO4J_COLORS_DISCRETE):

python-wrapper/tests/test_snowflake.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ def test_from_snowflake(session_with_minimal_graph: Session) -> None:
6060
)
6161

6262
assert VG.nodes == [
63-
Node(id=0, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 6, "table": "NODES"}),
64-
Node(id=1, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 7, "table": "NODES"}),
63+
Node(id=0, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 6}),
64+
Node(id=1, caption="NODES", color="#ffdf81", properties={"SNOWFLAKEID": 7}),
6565
]
6666

6767
assert len(VG.relationships) == 1
6868

6969
assert VG.relationships[0].source == 0
7070
assert VG.relationships[0].target == 1
7171
assert VG.relationships[0].caption == "RELS"
72-
assert VG.relationships[0].properties == {"table": "RELS"}
72+
assert VG.relationships[0].properties == {}

0 commit comments

Comments
 (0)