From 2f653ed9a0511ad3816485267d395a32e9eb6025 Mon Sep 17 00:00:00 2001 From: uhbrar Date: Fri, 23 Aug 2024 10:53:36 -0400 Subject: [PATCH 1/4] set new_attributes to empty --- reasoner_pydantic/kgraph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reasoner_pydantic/kgraph.py b/reasoner_pydantic/kgraph.py index 286cf4b..840064e 100644 --- a/reasoner_pydantic/kgraph.py +++ b/reasoner_pydantic/kgraph.py @@ -104,7 +104,7 @@ def update(self, other): if other.attributes: if self.attributes: # We need to make sure we don't add a second KL/AT - new_attributes = HashableSet[Attribute] + new_attributes = HashableSet[Attribute].parse_obj(()) for attribute in other.attributes: if attribute.attribute_type_id not in ( "biolink:knowledge_level", From cdfa249a6d85d14851bd18eecfe942b003174ae1 Mon Sep 17 00:00:00 2001 From: uhbrar Date: Fri, 23 Aug 2024 10:53:43 -0400 Subject: [PATCH 2/4] add test --- tests/test_update.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tests/test_update.py b/tests/test_update.py index 53a026e..9c6db09 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -479,7 +479,12 @@ def test_merge_knowledge_graph_edges(): "upstream_resource_ids": ["kp0"], }, ], - "attributes": [], + "attributes": [ + { + "attribute_type_id": "biolink:agent_type", + "value": "automated_agent" + } + ], } }, }, @@ -510,7 +515,12 @@ def test_merge_knowledge_graph_edges(): "upstream_resource_ids": ["kp1"], }, ], - "attributes": [], + "attributes": [ + { + "attribute_type_id": "biolink:agent_type", + "value": "automated_agent" + } + ], } }, }, From 099f930407f90dccea5d0285ca77f68f76339875 Mon Sep 17 00:00:00 2001 From: uhbrar Date: Fri, 23 Aug 2024 10:56:42 -0400 Subject: [PATCH 3/4] bump version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fa7eb62..efbb447 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="reasoner-pydantic", - version="5.0.5", + version="5.0.6", author="Abrar Mesbah", author_email="amesbah@covar.com", url="https://github.com/TranslatorSRI/reasoner-pydantic", From be82a25dd95e0263f885e3a8d275b66c014923ed Mon Sep 17 00:00:00 2001 From: uhbrar Date: Fri, 23 Aug 2024 10:58:33 -0400 Subject: [PATCH 4/4] black --- tests/test_update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_update.py b/tests/test_update.py index 9c6db09..825d1c3 100644 --- a/tests/test_update.py +++ b/tests/test_update.py @@ -482,7 +482,7 @@ def test_merge_knowledge_graph_edges(): "attributes": [ { "attribute_type_id": "biolink:agent_type", - "value": "automated_agent" + "value": "automated_agent", } ], } @@ -518,7 +518,7 @@ def test_merge_knowledge_graph_edges(): "attributes": [ { "attribute_type_id": "biolink:agent_type", - "value": "automated_agent" + "value": "automated_agent", } ], }