Skip to content

Commit

Permalink
Improving obj serializer
Browse files Browse the repository at this point in the history
  • Loading branch information
renan-souza committed Dec 18, 2024
1 parent abd9d4f commit ca478dc
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/flowcept/commons/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ def replace_non_serializable(obj):
return [replace_non_serializable(item) for item in obj]
else:
return obj
elif hasattr(obj, "__dict__"):
return obj.__dict__
else:
# Replace non-serializable values with id()
return f"{obj.__class__.__name__}_instance_id_{id(obj)}"
Expand Down

0 comments on commit ca478dc

Please sign in to comment.