-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Support serializing dataclasses #206
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
Added support for serializing Python dataclasses in event data, allowing for better integration with modern Python codebases.
- Added
_clean_dataclass
function inposthog/utils.py
to handle dataclass serialization - Added comprehensive test coverage in
test_utils.py
for nested dataclasses with various field types - Modified
clean
function to detect and process dataclass instances appropriately - Version bumped to 3.21.0 to reflect new feature addition
4 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, but I don't know enough about the release process on this lib so I'll leave that to you :)
Actually, question: won't that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
looking at CI we only explicitly support python 3.9 and above so good to directly reference dataclasses
Adds support for serializing Python dataclasses in event data.