Skip to content

Commit

Permalink
Avoid omitting scalar objects as circular dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
PetrHeinz committed Sep 16, 2024
1 parent b862ac3 commit d6e4619
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion logtail/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,14 @@ def _remove_circular_dependencies(obj, memo=None):
memo = set()
if id(obj) in memo:
return "<omitted circular reference>"
memo.add(id(obj))
if isinstance(obj, dict):
memo.add(id(obj))
new_dict = {}
for key, value in obj.items():
new_dict[key] = _remove_circular_dependencies(value, memo)
return new_dict
elif isinstance(obj, list):
memo.add(id(obj))
new_list = [_remove_circular_dependencies(item, memo) for item in obj]
return new_list
else:
Expand Down

0 comments on commit d6e4619

Please sign in to comment.