From c74b290ae1fa12b90ca01f6024d7fb9e028c0e3b Mon Sep 17 00:00:00 2001 From: Alexander Schlemmer <a.schlemmer@indiscale.com> Date: Fri, 11 Oct 2024 15:53:39 +0200 Subject: [PATCH] DOC: added docstring to describe_diff --- src/linkahead/apiutils.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/linkahead/apiutils.py b/src/linkahead/apiutils.py index d6549054..fab8c14f 100644 --- a/src/linkahead/apiutils.py +++ b/src/linkahead/apiutils.py @@ -527,6 +527,18 @@ def merge_entities(entity_a: Entity, def describe_diff(olddiff, newdiff, name=None, as_update=True): + """ + This function generates a textual representation of the differences between two entities that have been generated + using compare_entities. + + Arguments: + ---------- + olddiff: The diff output for the entity marked as "old". + newdiff: The diff output for the entity marked as "new". + + Example: + >>> describe_diff(*compare_entities(db.Record().add_property("P"), "value", db.Record())) + """ description = "" for attr in list(set(list(olddiff.keys()) + list(newdiff.keys()))): -- GitLab